The Daily Click ::. Forums ::. Klik Coding Help ::. Destroying bullets on level's edge.
 

Post Reply  Post Oekaki 
 

Posted By Message

eyeangle



Registered
  12/06/2003
Points
  1683
18th January, 2008 at 02:47:29 -

In my platfrom scrolling levels I need to destory a granade when it hits the left, right or down edge. But not top becasue I need the granade to come back down if it goes out of screen. I've tried 'Testing position of object' but this only works on the level edge, not the screen edge...

Thank.

 
theonecardgame.com

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
18th January, 2008 at 02:51:34 -

test the x values of the bullets to the x of the left and right visible edges of the screen and the y values of the bullet to the y of the top and bottom visible edges of the screen.

 
n/a

eyeangle



Registered
  12/06/2003
Points
  1683
18th January, 2008 at 21:11:33 -

I dunno, what you mean. Could you give me an example?

 
theonecardgame.com

Noyb



Registered
  31/05/2004
Points
  1117

VIP Member
18th January, 2008 at 22:26:49 -

You can get the position of a screen's edge under Storyboard Controls (the object always in the event editor in every game, that you usually use for scrolling). So you can make code like:

+X("grenade") > X Right Frame (Retrieve data from an object -> Storyboard controls -> Frame -> X coordinate of right visible edge)
- destroy grenade

+X("grenade") < X Left Frame
- destroy grenade

+Y("grenade") > Y Bottom Frame
- destroy grenade

 
"Omg. Where did they get the idea to not use army guys? Are they taking drugs?" --Tim Schafer on originality in videogames

eyeangle



Registered
  12/06/2003
Points
  1683
19th January, 2008 at 05:14:36 -

Thanks Noyb, worked a treat!

 
theonecardgame.com
   

Post Reply



 



Advertisement

Worth A Click