How do I make nom nom pacman app continuous move player

Get help using Construct 2

Post » Sun Mar 09, 2014 7:10 pm

I'm trying to modify the nom nom pacman tutorial, so the player moves all the time, like in a real pacman game
B
17
S
4
Posts: 20
Reputation: 1,245

Post » Sun Mar 09, 2014 7:42 pm

Every tick:

if pacman is facing up - set pacman Y position to pacman.Y-1

if pacman is facing down - set pacman Y position to pacman.Y+1

if pacman is facing left - set pacman X position to pacman.Y-1

if pacman is facing right - set pacman X position to pacman.Y+1


But I have not tested it. You also have to check if there are obstacles in the way before pacman moves.
B
10
S
2
Posts: 135
Reputation: 1,090

Post » Mon Mar 10, 2014 7:01 pm

I'm not certain where this every tick is under? Also wouldn't I need a boolean or am I over thinking the solution
B
17
S
4
Posts: 20
Reputation: 1,245

Post » Mon Mar 10, 2014 9:16 pm

The every tick is under system. You want the pacman to always move, so you will need every tick. I think you don't need a boolean.

If the user hits a key you can change the direction pacman is facing and/or moving. You can either use a variable for this and ask if this variable is 1, 2, 3 or 4 (for each direction). You can also safe "left", "right", "up", "down" instead in this variable. Or you can just change the direction pacman is facing and ask which direction he is looking.
B
10
S
2
Posts: 135
Reputation: 1,090


Return to How do I....?

Who is online

Users browsing this forum: Anonnymitet, DeXVinogradov, leena222, tatogame and 17 guests