Hi Nicolas,

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 (style=line).

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 "myGameHero",theRadius)=true then
      --collision has happened
    else
      --no collision has happened
    end if
  end if
 end repeat

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.

Cheers,

Malte

(*)

If you have layed out your maze you could use a repeat loop to set the cProp

repeat with i=1 to the number of graphics
  put the ID of grc i&cr after theList
end repeat
delete char -1 of list
set the allWalls of this card to theList
_______________________________________________
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to