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 / Hard Crash -- CloneSprite() + DeleteSprite() -- 2.0.14b

Author
Message
Nieb
9
Years of Service
User Offline
Joined: 13th May 2014
Location: Lurking
Posted: 29th Nov 2015 12:28
The attached code hard crashes while trying to delete sprites in a 2D array.

This code is rough-draft prototype code, probably not the way I'll end up doing things in the end.
But it perhaps shows a bug.

If this has already been fixed in 2.0.15 ignore this thread.

Attachments

Login to view attachments
Rickynzx
12
Years of Service
User Offline
Joined: 19th Dec 2011
Location: Troon, Scotland
Posted: 29th Nov 2015 17:01 Edited at: 29th Nov 2015 17:02
i tried your code in agk 2.0.15 and it still crashes.
i played about with the code a bit to try a few things but couldn't get it to work. the sprite definitely exists but cannot be deleted without it crashing.
Nieb
9
Years of Service
User Offline
Joined: 13th May 2014
Location: Lurking
Posted: 30th Nov 2015 00:09 Edited at: 30th Nov 2015 00:41
Thanks for testing!

I now see that using CreateSprite() with a separate LoadImage() would be a better approach, rather then cloning a "master sprite". I was using this 'clone a master' method with CreateObject() and InstanceObject() in my 3D games. Which is where the idea came from.

I've attached what I was attempting to accomplish.

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-04-26 23:39:09
Your offset time is: 2024-04-26 23:39:09