The Daily Click ::. Forums ::. Klik Coding Help ::. creating objects with fast loop
 

Post Reply  Post Oekaki 
 

Posted By Message

Paul_James



Registered
  02/07/2002
Points
  1320
20th March, 2007 at 23:12:27 -

Okay this maybe an easy answer but I was just wondering
how do you create objects using a fastloop so that they cover the screen

Im trying to create an object at 0,0, 40,0 0,40 40,40 etc.

is there a simpler way to do this rather than just have in one event
On loop - create object 0,0
create object 0,40 . . .
create object 320,240

 
Its not enough,I need more
Not enough to satisify
I said I dont want it, I just need it.
To believe, to feel, to know I'm alive.

Knuckle deep beneath the borderlines.
This may hurt a little but its something you'll get used to.
Relax. Slip Away...

Radix

hot for teacher

Registered
  01/10/2003
Points
  3139

Has Donated, Thank You!VIP MemberGOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!
20th March, 2007 at 23:39:11 -

run event once
---start loop "row" for (frame height / 40) loops

on loop "row"
---start loop "col" for (frame width / 40) loops

on loop "col"
---create object "active" at (0,0)
---active: set x position to LoopIndex("col")
---active: set y position to LoopIndex("row")

Haven't tested it, but that sounds right.

 
n/a

Pixelthief

Dedicated klik scientist

Registered
  02/01/2002
Points
  3419

Game of the Week WinnerWeekly Picture Me This Winner!You've Been Circy'd!VIP MemberI like Aliens!Evil klikerThe SpinsterI donated an open source project
20th March, 2007 at 23:50:58 -

set x position to LoopIndex("col") * 40
??

 
Gridquest V2.00 is out!!
http://www.create-games.com/download.asp?id=7456

Paul_James



Registered
  02/07/2002
Points
  1320
21st March, 2007 at 03:50:39 -

well radix it was right except the loop index would only make the next square created a pixel away from the last and not 40 so in the end i got a square that looked like it was 48x46

pixelthief was right i had to times it by X 40

thanks guys

 
Its not enough,I need more
Not enough to satisify
I said I dont want it, I just need it.
To believe, to feel, to know I'm alive.

Knuckle deep beneath the borderlines.
This may hurt a little but its something you'll get used to.
Relax. Slip Away...

Radix

hot for teacher

Registered
  01/10/2003
Points
  3139

Has Donated, Thank You!VIP MemberGOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!
21st March, 2007 at 09:36:37 -

Oh yeah, forgot that.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click