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.

Newcomers DBPro Corner / Higher resolutions, missing sprite...

Author
Message
Ashir
18
Years of Service
User Offline
Joined: 3rd Sep 2006
Location: Caracas, Venezuela
Posted: 28th Oct 2007 09:07
Hi guys, I was trying the above code and in resolutions highers than 1280x960 one sprite is missing. Why is this happening?

The link fot the image

http://img218.imageshack.us/img218/7949/basebg4.png

The code

jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 30th Oct 2007 02:38
the link gives me a blank page...

Your code isn't screamming "Broken" - fix the link - maybe you're using bad coords or something - or the stuff your grabbing is transparent via black - default color key I think - - dunno.

TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 30th Oct 2007 04:09
First of all, don't use Load Bitmap and then Get Image - just use Load Image - it's a lot easier.

Second, you have the line:

sprite 50,29,(screen height()/2)-6,4

Sprite 50 is probably the one which goes missing - you have used it already running down the centre of the screen so when you use the sprite number again, the first one disappears!

Have you actually considered how many boxes the following line draws?

for m=4 to screen height()-10

Try something like this instead:



TDK_Man

jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 30th Oct 2007 04:20
That was nice of you to dig in so thoroughly like that. Were you able to DL the link TDK? The Gfx?

TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 30th Oct 2007 04:30
Quote: "Were you able to DL the link TDK? The Gfx?"


No - blank page for me too!

It sounds daft, but with most short programs, I can usually run them in my head and see roughly what they do. That's why I whinge at people when they don't indent code properly as it makes it much harder to do - and therefore that much harder for me to help them.

The 'for m=4 to screen height()-10' line gave it away as it was creating sprites and without Step Value on the end, would have created around 1200 sprites!

Therefore, sprite 50 must have already been used.

TDK_Man

jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 30th Oct 2007 04:57
Quote: "It sounds daft, but with most short programs, I can usually run them in my head and see roughly what they do"


I code for a living - its not daft - I understand completely.

Ashir
18
Years of Service
User Offline
Joined: 3rd Sep 2006
Location: Caracas, Venezuela
Posted: 30th Oct 2007 15:47
Ohhhhh man, that was a VERY stupid mistake. I didn't notice that I have TWO sprites 50, in fact the first was going to be 5000 to avoid exactly this situation.

I hate to play duuuuuuuuuuuuuuuuuuuuuumb!!!!!!!!!!

By the way, it's not a blank page, the image shows in the upper left corner. it so small...

Thanks guys.
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 31st Oct 2007 21:43
I see the Sprite now - THEY ARE WHITE! You have to Highlight it with the mouse to see in a web browser - But glad you have your issue resolved.

Login to post a reply

Server time is: 2024-11-25 12:23:59
Your offset time is: 2024-11-25 12:23:59