a maze-game stack?
revolution at derbrill.de
Wed Jul 20 17:41:30 EDT 2005
if you like to use ArcadeEngine for a pacman like game here is a
out-of-the-top-of-my head approach.
Generate a maze using graphics as walls. each wall a graphic
Store the ID of the graphics in a custom property of the card e.g.
allWalls , each ID on one line. (*)
in a send in time structure you could have the following collision test:
repeat for each line theWall in the allWalls of this card
if intersect(button "myGameHero",grc ID theWall) then
put line 1 of the points of grc ID theWall into startPoint
put line 2 of the points of grc ID theWall into endPoint
put the width of btn "myGameHero" into theRadius
if circleLineSegmentCollide(startPoint,endPoint,the loc of btn
--collision has happened
--no collision has happened
This code snippet will check a collisions for all walls you have stored
in the custom property. The fun part is that wall now don´t need to be
right angled anymore, but can use any angle. :-)
If you want to go into detail just let me know. ;-) I´d like to help
writing a nice game again.
If you have layed out your maze you could use a repeat loop to set the
repeat with i=1 to the number of graphics
put the ID of grc i&cr after theList
delete char -1 of list
set the allWalls of this card to theList
More information about the Use-livecode