Player and monster movement in a non platform game

0 favourites
  • 3 posts
From the Asset Store
Players follower. use it for anything which follows the player
  • Hello,

    Drop box link here: dl.dropboxusercontent.com/u/19981154/Monstermovement.capx

    I wrote some event so the player and monsters in my game can move like the characters in double dragon. The conditions are:

    1) Player can move in all 8 directions, but only faces left or right.

    2) Monsters move toward player, but only faces left or right depending on relative position to player.

    Right now, my monster has no movement behavior. At every tick, it's position and angle are caculated by an event.

    My questions are:

    1) Is there a smarter way to move the monster? Right now it moves x pixels per tick.

    2) The current method will be better if I could have more control over the speed. I know I can set it to x pixels per 0.y seconds, but I rather control the numerator. Does Constructor support x.x pixels per tick? For example, 3.5 pixels per tick or 3.6? How precise can it be?

    3) In the capx file, event 8 is used to describe this monster's movement. If I want most monsters in the game to have this behavior, then is there a way to apply it universally? Or do I have to copy and paste it for each sprite?

    Thanks for reading!

    Edit: here is a follow up question. How do I set the angle/mirror state of each monster instance? Right now when I set one, all of them change.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 2) The current method will be better if I could have more control over the speed. I know I can set it to x pixels per 0.y seconds, but I rather control the numerator. Does Constructor support x.x pixels per tick? For example, 3.5 pixels per tick or 3.6? How precise can it be?

    Sweet! Constructor moves the monsters at different speeds even if the speeds are only 0.1 pixels/tick apart.

  • You should read the section of the manual covering "dt" or delta time. It ensures consistent movement speed across all browsers/computers. Basically you multiply your speed modifier by dt.

    scirra.com/tutorials/67/delta-time-and-framerate-independence

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)