Grid based movement?
I tried to replicate pacman, and I I had suspicions that what I was doing was a waste of time but I tried anyway to learn what not to do. It's obviously a bad idea to create packman by laying out actors as wall and trying to get him to move around them like pacman does. The actor would get hung up on corners no matter how precise I tried to be with them and you had to press the direction you wanted him to turn way ahead of time and just hope that the actor could make that turn, and over half the time he didn't. I think it's pretty obvious I need to create a grid for the actors to move around on. The problem is, it's not obvious to me how to accomplish this. What is the process to do this? Thank you for your time. Any and all help is greatly appreciated.
Comments
@DeepBlueApps has a great grid-based movement template called Collisions with Tables Template. I highly recommend it. Another thing to consider is that if you want the ghosts/enemies to move using AI, you'll need to employ some type of path-finder algorithm. Start here: http://forums.gamesalad.com/discussion/68703/intelligent-a-i-path-finding-with-gamesalad-has-anyone-ever-created-an-a-style-path-finder-setup.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I wondered if tables had something to do with it. I was also wondering how in the world I would do the AI on a grid. Thank you so much.
Seems really complicated... Hopefully I'll be able to figure it out.
I downloaded the deep blue apps template and I downloaded the gshelper grid based movement template. Seems a bit over my head at the moment.
Im not really sure how to define the grid within the game scene. Both templates seem to do them way differently. I like the deep blue apps template much more. I like how you can design the grid within the table and create walls in it. It's pretty confusing to me so far.
edit:
Looking at the deep blue apps template, what exactly defines the grid?
In the 16X16 actor for the first scene, looking at the move left rule:
tableCellValue( game.Table 1 , game.nextY , game.nextX -1)
I still pretty new to gamesalad so it takes me a little bit to understand things. I know that the table is made up of X and Y columns. so, first we have the behavior for tables, then selecting table 1, and then two game attributes for Y and X. Im not exactly sure how these two game attribute work but I assume the -1 is the left command.
But moving on there is a text behavior using an expression. I am having a really hard time understanding the purpose of it: "X: ".. game.nextX .." - Y: ".. game.nextY
There is the rule for if the boolean is false, do this: self.Position.X - self.Size.Width
Why am I taking the X position of the actor and subtracting it's width?
I don't understand the two constrain attributes at the top either...
Contrain attribute: game.nextX to: (( self.Position.X -( self.Size.Width /2))/ self.Size.Width )+1
and
constrain attribute: game.nextY to: 20-((( self.Position.Y -( self.Size.Height /2))/ self.Size.Height ))
Can anyone explain these? Why use this math here?
We have PacMan with a decent attempt at Ghost follow on DBA for 99p.
Darren.
Thanks Darren. I really like your templates. I plan to buy that one and the simple grid move template. But to be honest packman isn't my end goal. I was doing that for better understanding. I am really looking to understand the grid movement and design better. Pretty much what I need is exactly like your tables and grid template I mentioned above. I know you're an extremely busy man, but any chance I could get you to walk me though the math parts I listed above from your template?