Grid based movement for sprites

0 favourites
  • 7 posts
From the Asset Store
Snap to visible grid - perfect solution for any game genre
  • I was introduced to Construct 2 over the weekend, and absolutely like the tool! My son and I created a game in about 6 hours. It's based off of the GhostShooter example.

    What I would like to do now, is instead of having smooth movement, I would prefer my sprites to move according to a 32px by 32px grid ... moving one tile at a time. I've dug around a little and haven't found any good examples of a tilebased layout with grid movement.

    If someone could assist I'd greatly appreciate it!

  • Is THIS THREAD of use?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for the reply! Clicking through the links on that thread leads me to a lot of dead ends. I am really looking for an example project on how to do this ... is there a specific link available for that?

  • what behaviour are you using to move your sprites?

    Are you using the mouse or the keyboard to make the player move?

    Will the player be able to go diagonally or only straight?

    will the player be able to set destination further away than one grid-move?

    grid-based movement can mean a lot of different things to different people. In the FAQ there are some links to topics where people have tried. Using the search function you can find even more topics.

    Basically it's setting the destination of movement based on the size of your grid.

  • I'd like to use keyboard and mouse (touch) to move the "hero" sprite, and then move the enemy sprites at different times. I'm leaning towards just N,S,E and W movement. For now, just one tile at a time, future would be nice to give the hero a movement, something like 3 squares a second, and then let the user pick a spot on the map to move to.

    I'll revisit the links ...

  • I think I figured this out ... but not sure if this is the proper way ... just using keyboard commands.

    skydrive.live.com/redir

    Does this look correct? What if I wanted to limit them to one move per second?

  • I use dt that is Delta Time

    Which is about 1 second.

    But moving 32pixel on each keystroke is about 1 sec anyways.

    A good example of moving player tokens x number squares is this little Tutorial/demo comes in part 1 and 2

    Edit: Not everyone uses skydrive and doesn't have account to download. Suggest you get free dropbox or copy account to use for sharing. See my sig below - 20 gig for free.

    Just checked out your capx - that should work. You can also use the move at angle and put angle 0 and distance 32 for right and 90|32 for down etc etc

    Many ways to skin a cat - lol

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