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 / [BUG] CloneSprite( iSpriteIndex, iOtherSprite ) doesn't work?

Author
Message
Alex_Peres
AGK Master
15
Years of Service
User Offline
Joined: 13th May 2009
Location: The Milky Way Galaxy
Posted: 10th Jan 2019 23:40
I never used the CloneSprite( iSpriteIndex, iOtherSprite ) function but it seems like it doesn't work.
It does nothing.
Tested on Cloning project in tier1.

blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 10th Jan 2019 23:49
if you use;
newSprite = CloneSprite ( 1 ) // it works
if you use
newSprite = 5
CloneSprite (newSprite, 1 ) // it works

I think the problem is you're creating newSprite first so it can't clone a sprite into an existing sprite
Alex_Peres
AGK Master
15
Years of Service
User Offline
Joined: 13th May 2009
Location: The Milky Way Galaxy
Posted: 11th Jan 2019 16:22
Thanks, blink0k.
But it doesn't make any sense.
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 11th Jan 2019 18:35 Edited at: 11th Jan 2019 18:36
@Alex_Peres
Newsprite could be a variable and then you just increase the variable every time you press left mouse key .

I'm not a grumpy grandpa
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 14th Jan 2019 12:42
Your problem is right here:

newSprite = CreateSprite(0)

CloneSprite (newSprite, 1 )

You can't clone a sprite to a sprite number that already exists.
Tiled TMX Importer V.2
XML Parser V.2
Base64 Encoder/Decoder
Purple Token - Free online hi-score database
Legend of Zelda

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
Alex_Peres
AGK Master
15
Years of Service
User Offline
Joined: 13th May 2009
Location: The Milky Way Galaxy
Posted: 30th Jan 2019 16:44
"You can't clone a sprite to a sprite number that already exists."
But it is wrong! It would be so much easier if I could.
Bengismo
7
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 30th Jan 2019 16:53

Maybe just add one line to check if it is currently already used then....

if GetSpriteExists(newSprite) then deletesprite(newSprite)
CloneSprite (newSprite, 1 )

Login to post a reply

Server time is: 2024-11-23 05:47:15
Your offset time is: 2024-11-23 05:47:15