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.

Dark GDK / Problem with scaling sprites

Author
Message
jontepd
15
Years of Service
User Offline
Joined: 24th Feb 2009
Location: Sweden
Posted: 17th Nov 2009 13:37
I'm currently making an asteroids game, and when the player hits one of the asteroids it is supposed to split into two smaller asteroids. To achieve this I have made a create function inside the asteroid class. Whenever the players hits an asteroid the create function is called twice which creates an asteroid and then rescales it depending on what the value of the size variable is.

The problem is that when the asteroids are scaled they cover practically the entire screen for a very small amount of time (under a second) before they are properly scaled.

I have tried hiding the sprite using dbHideSprite before it is scaled and then using dbShowSprite after the sprite is scaled but that didn't help.

Any help would be greatly appreciated!


Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 17th Nov 2009 15:12 Edited at: 17th Nov 2009 15:12
Yeh, I remember this problem, I have not used sprites for a couple of years but I think I used to place them off the screen first and then move them into position.

I think it is a problem with the create sprite function.

Login to post a reply

Server time is: 2024-10-01 18:41:09
Your offset time is: 2024-10-01 18:41:09