The Daily Click ::. Forums ::. Klik Coding Help ::. Random placement of objects...
 

Post Reply  Post Oekaki 
 

Posted By Message

KevinHaag



Registered
  28/01/2005
Points
  266

VIP Member
14th June, 2005 at 10:52:26 -

http://www.img155.echo.cx/img155/9097/image6te.png

Does anybody know how I can make it so the "aliens" every 3 seconds are placed at a random position just outside the playfield? And then walk into the playfield?

The picture link above should help explain what I mean...

P.S. Im using TGF

Image Edited by the Author.

Image Edited by the Author.

 
Image
http://www.kevinhaag.ca

DaVince

This fool just HAD to have a custom rating

Registered
  04/09/2004
Points
  7998

Game of the Week WinnerClickzine StaffHas Donated, Thank You!Cardboard BoxDos Rules!
14th June, 2005 at 11:18:49 -

The image link doesn't work.

 
Old member (~2004-2007).

Noyb



Registered
  31/05/2004
Points
  1117

VIP Member
14th June, 2005 at 11:26:29 -

I can't see the picture either. You could make a bunch of "alien spawner" objects outside of the playfield (set to not follow scrolling). Then,
Every 3 seconds + pick one "alien spawner" : create alien at (0,0) from "alien spawner".
Alien's Flag 0 is off: alien look at center of screen or player (just to get it initally in the playfield), set flag 0 on.

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

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
14th June, 2005 at 11:49:39 -

Easy really.

create one at the top (-50 of the Y axis so it will be above the top of the viewable screen) then choose a random position along the X axis - random (320) - i'm assuming your window will be 320 pixels wide. The make its direction down or whatever so it will walk on screen.

the do the same for the bottom and sides.

 
.

KevinHaag



Registered
  28/01/2005
Points
  266

VIP Member
14th June, 2005 at 13:12:40 -

Thanks! Ill try that as soon as i get home... as Im at school right now... bored out of my mind...|:-|

 
Image
http://www.kevinhaag.ca

KevinHaag



Registered
  28/01/2005
Points
  266

VIP Member
14th June, 2005 at 15:49:40 -

Here is th image link again:

http://img238.echo.cx/img238/7333/image5ih.png

Image Edited by the Author.

 
Image
http://www.kevinhaag.ca
   

Post Reply



 



Advertisement

Worth A Click