Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Solution approach for upcoming pacman games GHOST AI's.
- clone food sprite list and periodically [each n moves depending on ghost] use rng to select new ghost target tile, trimming list after evaluating the ghost current coordinates and target cells cordinates.
- traverse list from position, generate new list when either of the following is true:
- - Ai reaches target tile
- - Pacman is closer to ghost than ghost is to target tile
- - ? Update list when any node is encounterd; Mantain list of nodes
- - ? maintain lists for each ghost with their position relative to pacman and assess string length / value to determine the shorter path.
- Food sprite list must fall within batch line limit. Original pacman grid size of 28x 36 cells should support this.
- Add refresh.sprite macro to Game_Engine.bat macro to support food trail reset
- - iterate over sprite list and test cell for definition. if not defined, define using sprite list value.
- - output any re-definitions to foreground file, type file.
- Expand refresh.sprite macro on food collection.
- ? Additional Macro's for Game engine Get.Trail Follow.trail
- ::: [ ? Single Cell Sprites only - may be expanded for multi cell sprites ; though intent is to limit actions for efficiency ]
- - Get.Trail
- - Arguments:
- - Object identity via substring modification
- - Target Cell 0,0
- - Origin Cell 0,0 [ Obj.ly;Obj.lx ]
- - List Varname Containing Full Trail
- - Actions:
- - ? Clone Trail, Trim via substring modification retaining positions between Target Cell and Origin Cell
- - Trim list to consider Relation of Target 0,0 and origin 0,0 and:
- - If Target x/y GTR origin x/y 0,0 remove cells containing x/y values LSS than origin
- - If Target x/y LSS origin x/y 0,0 remove cells containing x/y values GTR than origin
- - Return trimmed trail to obj.path variable
- - Follow.Trail
- - Arguments:
- - Object identity via substring modification
- - Collide / Capture Args
- - Actions:
- - Test next cell in lists definition for collide / capture args, return values if True
- - Move Object to Next cell in list
- - remove cells new location from list
- - Update cells definition with Objects value
- - Undefine and clear cells previous position using Obj.l{X/Y} values
- - Update Obj.lum{X/Y} values
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement