Grid Movement and Prevention Issue

6 replies [Last post]
BoxWorks's picture
User offline. Last seen 19 weeks 16 hours ago. Offline
Joined: 10/17/2009
GBPs: 1218

I have a Grid Movement set up and I have collisions working fine.

My grid movement works by:

  • Counter - Is player moving?
  • Movement - Path movement for each direction
  • Sensors - If player is over this, prevent player from moving in x direction.
  • Control - Arrow Keys

The player uses the arrow keys to control the "Painter" which moves around on the grid. The objective of the game is to fill all the tiles without going back on the tiles you have already painted. There are sensor blocks which prevent the player from moving in a certain direction.

Arrow keys trigger path movements in each direction, and this only works if the "Is moving?" counter is equal to 0, and the respective sensor is also equal to 0.

The problem I am having is with the painted blocks. I have it so that when the player overlaps the painted block, it changes the animation to "Painted." I now want the player to be unable to move over the painted blocks if they have already been painted.

Does anyone have any ideas on how to do this?

RickyRombo's picture
User offline. Last seen 16 weeks 3 days ago. Offline
Joined: 08/16/2009
GBPs: 3395

Teehee, it sounds like PaintIt by JasonOrme - with a twist!

Cool idea, I'd try testing to see what animation the block is playing upon overlap.

eg

Player overlaps brick
+ Brick animation == "Painted"
-- Game over


I am RickyRombo, and I approve this message.

BoxWorks's picture
User offline. Last seen 19 weeks 16 hours ago. Offline
Joined: 10/17/2009
GBPs: 1218

Good idea, but here's the problem: The player paints the block when he/she moves onto it. Therefore, as soon as the character paints the block, they lose.

RickyRombo's picture
User offline. Last seen 16 weeks 3 days ago. Offline
Joined: 08/16/2009
GBPs: 3395

Well you have a couple of options --

A) Rather than make it painted right there on the spot, just make it look like it's painted and switch a flag on, and as soon as it's not overlapping the player, make it painted.

B) Paste objects as obstacles over the grid instead of using an animation, and use the storyboard object to test to see if the next square is an obstacle.

C) Create a detector that travels in front of the player that detects overlapping painted square.

I recommend A or C


I am RickyRombo, and I approve this message.

BoxWorks's picture
User offline. Last seen 19 weeks 16 hours ago. Offline
Joined: 10/17/2009
GBPs: 1218

This issue has now been resolved. There is not need to comment anymore, or provide help.

However, if you do, you get cookies!

RickyRombo's picture
User offline. Last seen 16 weeks 3 days ago. Offline
Joined: 08/16/2009
GBPs: 3395

What method did you do? How did you solve it :)


I am RickyRombo, and I approve this message.

BoxWorks's picture
User offline. Last seen 19 weeks 16 hours ago. Offline
Joined: 10/17/2009
GBPs: 1218

OldManClayton suggested to put sensors all around the player, and delete the sensors on the floor. Delete the paint blocks with separate animations on the floor, and have the player create a "Paint" block when he stops moving. Then, whenever the sensors around the player are overlapping either an obstacle or paint block, the player will not be able to move in that direction.

As for the winning condition, it depends on how many paint blocks have been created in the play area zone.

So that means the game engine has been completed, and only levels and graphics are to be finished!

Thanks for your help everyone!