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

Post Reply  Post Oekaki 
 

Posted By Message

Dave S.



Registered
  26/09/2003
Points
  924
4th February, 2005 at 14:51:56 -

Lets say I want to randomly position FIVE objects on any one of SIX designated x,y points on a level screen. What is the easiest way to do this?

I normally use 'swap position with another object' which works well on active objects but does not seem to work properly with 'alpha objects'. Also, if I do it this way, objects can never position themselves on the vacant x,y point.



 
n/a

Assault Andy

Administrator
I make other people create vaporware

Registered
  29/07/2002
Points
  5686

Game of the Week WinnerVIP Member360 OwnerGOTM JUNE - 2009 - WINNER!GOTM FEB - 2010 - WINNER!	I donated an open source project
4th February, 2005 at 19:42:18 -

You could have 5 invisible objects(Invisibleobject) and then have your five objects that you want to place(placeme):

*Invisibleobject.Is not overlapping 'placeme' > Placeme.x = invisibleobject.x
+Pick an Invisible object at random > Placeme.y = invisibleobject.y

 
Creator of Faerie Solitaire:
http://www.create-games.com/download.asp?id=7792
Also creator of ZDay20 and Dungeon Dash.
http://www.Jigxor.com
http://twitter.com/JigxorAndy
   

Post Reply



 



Advertisement

Worth A Click