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 / Placing an animated sprite in between static sprites

Author
Message
Thinking Cap
15
Years of Service
User Offline
Joined: 11th Jun 2009
Location:
Posted: 11th Jun 2009 08:43
I have researched my problem for awhile, and I apologize if there was a thread with the solution to my problem that I missed, but I can't find anything on it. I'm making a game that is set up like Phoenix Wright, with a 2D character talking at the player from behind a text screen that lies on the bottom of the screen. I'm just trying to format all of the sprites right now before I move on to the gameplay, but when I try to place an animated sprite behind the text box, it doesn't show up.

Here's my code:



I hope I did that right (I've never posted in these forums before) I also can't get the font to change either, but I haven't really researched it since I've been so focused on fixing the sprite issue. Any advice is welcome and greatly appreciated!

Thank you,

Thinking Cap
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 11th Jun 2009 21:36 Edited at: 11th Jun 2009 21:37
It seems that the text is not a problem, but your static images are. If I just comment out the static sprites, both the text and the animated sprites show up all right.

I think the problem is that you are using the same numbers for different objects. You use numbers 1, 2, 3 for static sprites and then with the loop, create sprites from 2 to 30. That means 2 and 3 are re-used and one of the two sprites will be lost. Try giving your static images different numbers from the dynamic ones. Also, try placing them at different coordinates to make sure that a static image does not cover the dynamic ones.

My last remark is your deletion loop at the end of the program, which apparently tries to delete image one 30 times. Put the loop variable "i" into the dbDeleteImage command.
Thinking Cap
15
Years of Service
User Offline
Joined: 11th Jun 2009
Location:
Posted: 12th Jun 2009 01:15
Perfect!! Thank you, that makes a lot of sense, and I'll be sure to fix my deletion loop. Thanks again!

Login to post a reply

Server time is: 2024-10-01 03:27:07
Your offset time is: 2024-10-01 03:27:07