The Daily Click ::. Forums ::. Klik Coding Help ::. 'snap to grid' effect
 

Post Reply  Post Oekaki 
 

Posted By Message

LittleGuy (Ecstasy Studios)



Registered
  22/12/2002
Points
  1497
16th June, 2003 at 15:54:51 -

Hi guys!
Im making a game were i want the character to be able to move smoothly but i also want a kind of 'snap to grid' effect where he must move inside the cells of the grid and not move around freely. The best way I can describe it is like the pacman movement.
Can anyone point me to a helpfull article on this. I have TGF Pro.

 
A Crusader for the LittleGuy's

Click Cell, a full fat community site, http://clickcell.tk

Mr Saturn



Registered
  14/05/2002
Points
  357
16th June, 2003 at 19:33:24 -

Go to www.clickteam.com and search the forums for "grid movement". There are a HUGE amount of downloadable examples about this at the CT forums.

 
n/a

Assault Andy

Administrator
I make other people create vaporware

Registered
  29/07/2002
Points
  5686

Game of the Week WinnerVIP Member360 OwnerGOTM JUNE - 2009 - WINNER!GOTM FEB - 2010 - WINNER!	I donated an open source project
17th June, 2003 at 01:09:31 -

Everyone wants to know how to do this! The best way is to have an alterable value for a direction, then when you pressed right - set the alterable value to the grid size. Eg.

Repeat while "Right" is pressed - player.alt a = 32 gridsize)
+ player.alt a = 0 -

If player.alt a >0 - player.x = player.x + 1
- player.alt a = player.alt a - 1

Then you can repeat this for all directions using a differant alterable value. But if you don't want to use 4 alterable values, then use flags or negative numbers.

-Andy

 
Creator of Faerie Solitaire:
http://www.create-games.com/download.asp?id=7792
Also creator of ZDay20 and Dungeon Dash.
http://www.Jigxor.com
http://twitter.com/JigxorAndy

LittleGuy (Ecstasy Studios)



Registered
  22/12/2002
Points
  1497
21st June, 2003 at 10:08:12 -

very confusing, my interpretation of what you siad turned out, well, lets just say it didn't work.

 
A Crusader for the LittleGuy's

Click Cell, a full fat community site, http://clickcell.tk

LittleGuy (Ecstasy Studios)



Registered
  22/12/2002
Points
  1497
21st June, 2003 at 10:31:31 -

wait, ive done it, thanx


 
A Crusader for the LittleGuy's

Click Cell, a full fat community site, http://clickcell.tk
   

Post Reply



 



Advertisement

Worth A Click