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 / Help with sprites

Author
Message
Hive32
14
Years of Service
User Offline
Joined: 9th Nov 2009
Location:
Posted: 10th Nov 2009 01:12
Hi, I will try and explain my problem as best as I can, hopefully there is a simple fix. I have a simple image of a 10*10 grid of squares as a background and a simple square sprite as a marker that moves around on top of the grid image. These are representing the part of my program which simulates a character moving around the grid. The character can also "see" the grid directly to the left, right, top, and bottom of its current location. To show the "explored" grid zones I thought I would draw a sprite of a different color over each grid that the character can "see", including the one at its current location, I store whether each location can be "seen" in a simple 10*10 array. My problem is I can't seem to make a sprite at those locations to show it is "explored" and have it remain on the screen, it always disappears after every time the darkgdk main loop executes. I don't know of the best way to make the sprites stay on the screen, or if that approach is even viable. Could anyone help? If my code would help, I can post that when I am back on my normal computer. Thanks in advance.
american eagle
17
Years of Service
User Offline
Joined: 2nd Aug 2007
Location:
Posted: 10th Nov 2009 12:24
yeah If u post the part of your code that deals with that I maybe help you I think I understood your problem and I think I know the solution but I have to see the code to be sure and not to confuse you more..
Hive32
14
Years of Service
User Offline
Joined: 9th Nov 2009
Location:
Posted: 10th Nov 2009 23:34
Okay, I think this part of the code will hopefully be at least understandable. I realized my problem I think is a lack of understanding of dbSynch() and when to use it. Basically I want my sprite 2 to move around the grid image, and I want the sprites using image 3 to be created around sprite 2 and then stay there. This sort of works, but its very jumpy and things are drawn multiple times on the screen sometimes. Also, the setSprite command now seems to be necessary for the program to display right at all, which is a new thing. Thanks.

I hope the code isn't too long and annoying.

Login to post a reply

Server time is: 2024-10-01 16:47:04
Your offset time is: 2024-10-01 16:47:04