Be a Supporter!

AS2: rpg walking help

  • 374 Views
  • 3 Replies
New Topic Respond to this Topic
mattf42093
mattf42093
  • Member since: Feb. 2, 2010
  • Offline.
Forum Stats
Member
Level 02
Blank Slate
AS2: rpg walking help 2010-03-26 17:32:54 Reply

I'm trying to make a sprite rpg like pokemon where only the background moves when the character walks and the character moves a certain amount of pixels per step, can someone help me out?

4urentertainment
4urentertainment
  • Member since: Aug. 1, 2008
  • Offline.
Forum Stats
Moderator
Level 13
Game Developer
Response to AS2: rpg walking help 2010-03-26 17:44:15 Reply

Just move the background in the opposite direction of where the player should be going. So if you're pressing right, the background would go left.

mattf42093
mattf42093
  • Member since: Feb. 2, 2010
  • Offline.
Forum Stats
Member
Level 02
Blank Slate
Response to AS2: rpg walking help 2010-03-26 18:51:51 Reply

At 3/26/10 05:44 PM, 4urentertainment wrote: Just move the background in the opposite direction of where the player should be going. So if you're pressing right, the background would go left.

ok but also what about how they walk on tiles, like everytime you walk up to a door its perfectly aligned

Fabzilla
Fabzilla
  • Member since: Mar. 24, 2005
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Response to AS2: rpg walking help 2010-03-27 13:14:24 Reply

do summit like...

walking_right = false;
walking_timer = 0;

if( // Right Key Pressed && walking_right == false ){
walking_right = true;
}

if( walking_right == true ){
hero._x +=5;
walking_timer ++;
}

if( walking_timer == 4 ){
walking_timer = 0;
walking_right = false;
}

key down makes walking = true.
walks 4 times.
when at 4 resets everything.

i hope that's what you wanted.

also check out this link about tile based games. it's really good... http://www.tonypa.pri.ee/tbw/


BBS Signature