Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / CloneSprite

Author
Message
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 10th Jan 2014 15:51 Edited at: 10th Jan 2014 16:22
I want Clone one Sprite 10 times. for clone it i should write 10 times CloneSprite() and SetSpriteposition() Functions?

I want use clone sprites for make platform ground Tile.
DavidAGK
AGK Developer
10
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 10th Jan 2014 16:49
In a for next loop would do it swiftly
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 10th Jan 2014 17:10
If your sprites are 16x16 pixels in size. Assuming you have created the first brush sprite, which will be cloned...

for n=0 to 9
x=n*16
y=100
spr=clonesprite(brush)
setspriteposition(spr,x,y)
next n

If you change the range that N steps through, then you change the position of the platforms - most of the time people make a map array to hold the data then use that when creating sprites - might just be setting the sprite frame, but could do a lot more, like set whether or not a sprite is solid. I think it's worth considering how you'll handle the rest of the level - always better to go at these things with a good plan.

I am the one who knocks...
Behdadsoft
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 10th Jan 2014 17:17
Thanks Van B, your help is useful.

Login to post a reply

Server time is: 2024-11-24 23:34:37
Your offset time is: 2024-11-24 23:34:37