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 / Weird problems whit sprite function?

Author
Message
Kikkeli
20
Years of Service
User Offline
Joined: 11th Feb 2004
Location:
Posted: 20th Feb 2004 11:47
Hello,
Im having problems again... Why this code don't work? It just gives black screen to me...



In compiler im using Full Screen Exclusive Mode (800*600*16) at Display Settings. If i put it to 800*600*32, my program can't start (says only "32 Bit is not Supported at Hardware line 0"). Well, is the problem my VoodooIII, or is the code incorrect? But, i have problems only whit sprite -function. Bitmap fucntions(LOAD BITMAP... CREATE BITMAP...) works fine.

My computer:
133 Mhz
Voodoo III 32 MB
128 MB Ram
10 G harddisc

, Thank you

DBP43V3R
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 20th Feb 2004 20:34
voodoo only handle 16 bit, so asking for 32bit is a little optimistic , your code is a little "clunky" this should work fine...

HIDE MOUSE: SYNC ON:SYNC RATE 0
rem handling your syncs is neater, faster and gives more control
CLS

Rem This is 256 colour normal Bacround:
no need to name bitmap zero since this is default bitmap
LOAD BITMAP "backround.bmp"

Rem 256 Colour Human model whit Transparency.
rem just load the human into a image, no need to go via bitmap
LOAD IMAGE "human.bmp", 1

rem the above makes this bit redundant >>> GET IMAGE 1,0,0,300,300

rem loop that shows sprite repeatedly until you press q
REPEAT
SPRITE 1,170,90,1
SYNC
UNTIL INKEY$()="q"

END

cheers.

Mentor.

System spec : Pentium 3.0Ghz, 512MB DDR, 2x160Gb HD (using icewave hd coolers ), DVD RW/CD RW (all modes), multimedia front panel, 6 way surround sound, ATI radeon 9800Pro 128mb.
Kikkeli
20
Years of Service
User Offline
Joined: 11th Feb 2004
Location:
Posted: 21st Feb 2004 10:41
I don't know what is wrong, but only human.bmp works. The bacround.bmp is not painted at all, bacround is blue.



DBP43V3R
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 21st Feb 2004 13:38 Edited at: 21st Feb 2004 13:47
oh! IIRC you have to set the backsave on the sprite in pro (but that may crash your computer..it does mine), I am currently using classic, pro is too much trouble to actualy make anything but snippets in, the command is something like

set sprite sprite_number,backsave,transparency

if you have the transparency/backsave off then the whole screen gets blanked out (stupid sprite setup IMO...as is the collision), classic is MUCH better (apart from the speed that is), most of the problems with Pro sprites come from them being 3D plains (hence that blue background...only happens when 3d is active), software sprites may be slower but at least they have decent (pixel perfect) collision and work properly.

Mentor.

NOTE: Anti pro grumbles due to 8th crash this morning..no errors etc, thanks to pro, GET IT FIXED!!!

System spec : Pentium 3.0Ghz, 512MB DDR, 2x160Gb HD (using icewave hd coolers ), DVD RW/CD RW (all modes), multimedia front panel, 6 way surround sound, ATI radeon 9800Pro 128mb.
Kikkeli
20
Years of Service
User Offline
Joined: 11th Feb 2004
Location:
Posted: 21st Feb 2004 19:03 Edited at: 21st Feb 2004 19:05
Im totally ... i tryed to compile different codes about hour, but i can't get em to work. Please, can someone paste me working demo code, so i can decide how these stuff works (you can use this code, you can edit it so it works):



, Thank You

DBP43V3R
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 21st Feb 2004 21:00
umm, I tried but it still crashes my PC, it should be just

HIDE MOUSE: SYNC ON:SYNC RATE 0
CLS

LOAD BITMAP "bacround.bmp"
LOAD IMAGE "human.bmp",1,1

SPRITE 1,170,90,1
SET SPRITE 1,1,1

REPEAT
SYNC
UNTIL INKEY$()="q"

END

or something like that, but it just crashes my system with no errors indicated, locks up and all I have left is holding the power button in for four seconds to restart my system, not exactly what you want I suspect.

Mentor.

ps: background is spelt wrong in your source, does the file realy have that name?

Get Pro sorted, I am a customer not a BETA tester.
Kikkeli
20
Years of Service
User Offline
Joined: 11th Feb 2004
Location:
Posted: 21st Feb 2004 21:34 Edited at: 21st Feb 2004 21:40
This gives only black screen to me, and after key "q" (quit command) it says "Runtime Error 506 - Could not load image at line 5".

And, im 99 % sure, that i have those images in right directory.


"ps: background is spelt wrong in your source, does the file realy have that name?"

They are not really background.bmp and human.bmp (in my project they are t1.bmp and s1.bmp, I just call them those because it will be lot of easier understant code if sprites (images) have good names. So, don't worry, Im sure that file names are not the problem.
........
But, can someone (please!) help me whit this problem. I just need a working example code. I have spend lot of time compiling codes what don't work correct and I don't know anymore what is wrong. Even some tutorials code didn't work... don't know why.

EDIT:

Example, it gives black screen to me. No errors.



DBP43V3R
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 21st Feb 2004 21:43
Where did your 0 (zero) go you had it in your frist bit of code

Quote: "
LOAD BITMAP "backround.bmp", 0

"


In Space No One can Hear You Scream! (When your comm Line is cut?)
Kikkeli
20
Years of Service
User Offline
Joined: 11th Feb 2004
Location:
Posted: 21st Feb 2004 22:16 Edited at: 21st Feb 2004 22:17
Quote: "Where did your 0 (zero) go you had it in your frist bit of code"


No need to name bitmap zero since this is default bitmap
LOAD BITMAP "backround.bmp"

Right?

DBP43V3R
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 21st Feb 2004 23:34
just tried this in classic...since it crashes in pro, and it works fine apart from I had to alter the sync rate to 60 since the screen was flickering at 0, I think thats more an issue with my over-the-top pc and classic being so old rather than code problems, sorry I can`t help any further.

Mentor.

Get Pro sorted, I am a customer not a BETA tester.

Login to post a reply

Server time is: 2024-09-21 22:20:59
Your offset time is: 2024-09-21 22:20:59