| 123456789101112131415161718192021222324252627282930313233 |
- p2 = {
- -- Pushed values to this object on update (self.xxx)
- -- x,y (in) : top left corner of the entity
- -- vx,vy (in) : Velocity
- -- width (in), height : dimensions of the map<->entity hitbox
- -- points (in) : scored points
- -- intent (in-out) : Intended direction of the entity when it'll can.
- -- Editing intent will impact the AI's deplacement.
- -- The game structure
- -- The map is stored as 8*8pixel tiles.
- -- The map has a dimension of 224*248 pixels (borders included).
- -- To push the IA to move to another direction when it can, edit self.
- -- The game structure stores the players' and ghosts' position (in pixel) and velocity
- -- gamestructure.p1.x
- -- gamestructure.p2.y
- -- gamestructure.blinky == red
- -- gamestructure.inky == cyan
- -- gamestructure.pinky == huh
- -- gamestructure.clyde == orange
- -- gamestate functions
- -- Note : All of those functions needs gamestate.data as first argument
- -- collide(gamestate.data, x,y,w,h) checks if a rectangle defined by its left corner and its dimensions collides with the walls.
- -- get_gum(gamestate.data, x, y) returns the gum if there is one at this position. Gets pixel coordinates (not tile position)
- init = function(self)
- end,
- update = function(self)
- self.intent = math.random(0, 4)
- -- print("p1.x : "..gamestate.p1.x)
- end
- }
|