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.

2D All the way! / Help with 2d overhead movement

Author
Message
Celtic Mage
21
Years of Service
User Offline
Joined: 30th May 2005
Location: Hyrule
Posted: 17th Jul 2005 06:56
I am trying to make an RPG game, and have already sucessfully made a terrain for the character to be on. The only problem is that I keep getting the blue screen whenever the sprite loads. I have downloaded a tutorial on how to fix it, but none of the methods work without creating a second problem. Using CLS in my loop would get rid of it, but also it would delete my tiles. I tried disabling backsave, but then when my character would move, it left a streak of the background color behind. From here I don't know what to do about it. My code for
the terrain and movement is enclosed. Keep in mind that I was just testing the system, so it is only 640x480, and the hero only has one frame.
pizzaman
22
Years of Service
User Offline
Joined: 18th Feb 2004
Location: Gateshead, UK
Posted: 18th Jul 2005 02:57
First off turn off the sprite's backsave just like you said. Then every loop just redraw the map to the screen and then paste your character to the screen.

Also this might help you

http://www.thegamecreators.com/?m=codebase_view&i=0ee878a92195ee8c39c59bc3196e47d1

Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 18th Jul 2005 05:20 Edited at: 18th Jul 2005 05:32
Pizzaman is right. The background needs to be replaced anytime you use the sprite.

I assume your using Darkbasic Pro since you have the dreaded blue screen problem.

In your code you had it syncing in the middle of drawing the map. This is only needed if you want the user to see it drawing. If you remove any syncing (as I have done) the background appears instantly. You only need one "sync on" command (usually at the top) and always use "sync rate 0" to update as fast as the computer can handle (fastsync is ok too but I prefer sync rate 0).

After the background is drawn use "get image" to keep the background image. Here I used "screen width()" and "screen height()" because I didn't know what resoultion you were making this for. If you don't have "set display mode" in your full code you should add it... that way you know for sure where graphics are going to be when a person runs the program (it looks like you used the default). Use "set display mode 640,480,32" to force the screen size.

On all the image loading and the one get image command I added a ",1" to the end. One of the things that's annoying in Darkbasic Pro is that all images are automatically anti-aliased unless you add the ",1" at the end.

You don't need a sprite command right outside of a do loop that has the same sprite. It's so close to the sprite command in the do loop that it'll be instant without the first sprite command.

You had the sprite hiding then changing the x or y then showing the sprite again. This is not needed. Sprites move around the screen easily without the need to hide them before any changes.

Paste sprite puts the sprite on the background which (it appears) isn't needed here either. You want the sprite to stay exactly where your character is so you can use collision checks to see if they get hit or touch other sprites.

At the last part "paste image 100,0,0" is where the blue screen of death is replaced with your background. In this code I have it paste before the sprite but it doesn't matter since sprites are always on top.

Hope this helps.

Login to post a reply

Server time is: 2026-06-12 09:26:02
Your offset time is: 2026-06-12 09:26:02