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 / sprite help..newbie

Author
Message
iori
19
Years of Service
User Offline
Joined: 26th Jan 2005
Location:
Posted: 7th Mar 2005 17:50
here is the code thats taken from the only book on darkBASIC that i know of: "Beginner's Guide to DarkBasic Game Programming" and it doesnt work:


i am not able to see "F15.bmp" although its path is correct.anyone?

Thanks
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 7th Mar 2005 18:53
DBC or DBP?

Would be load image command for DBP instead of load bitmap for sprites.

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 7th Mar 2005 19:00 Edited at: 7th Mar 2005 19:00
When you load a bitmap, it becomes the active bitmap. So bitmap 1 is active after loading both of them.

The screen is always bitmap 0, but because you never reset it after loading bitmap 1, it's not getting updated. Your code should look like this:



Alternatively, once you have created your image, you can delete bitmap 1. The current bitmap will automatically revert back to 0.

BatVink
iori
19
Years of Service
User Offline
Joined: 26th Jan 2005
Location:
Posted: 8th Mar 2005 02:37
thanks for replying.i am using DBP. When did "set current bitmap 0" i can only see "F15.bmp" and not the "background.bmp" anymore. i want F15.bmp sprite to show up on the background.
Krad2004
19
Years of Service
User Offline
Joined: 8th Mar 2005
Location:
Posted: 9th Mar 2005 06:23
im having the same problem, using set current bitmap 0, instead of the sprite displaying over the background, the spite displays over a blue background
Krad2004
19
Years of Service
User Offline
Joined: 8th Mar 2005
Location:
Posted: 9th Mar 2005 21:55
I've done it!!!! I was up late last night trying all of the sprite commands one by one and i've finally got it (with the help of BatVink). Modify ur code to the one i have supplied here.

also look at the image i have attached.

hope that helped

Attachments

Login to view attachments
Krad2004
19
Years of Service
User Offline
Joined: 8th Mar 2005
Location:
Posted: 9th Mar 2005 22:03
it just proofs that with a little time and effort, u can learn this language by ur self, i was trying blitz basic and darkbasic to see which one i am going to buy, i think i'll go with darkbasic, i cant wait till i get my money together!!!
Krad2004
19
Years of Service
User Offline
Joined: 8th Mar 2005
Location:
Posted: 10th Mar 2005 03:20
sorry if you cant get the source code from my other post, here it is again:

hide mouse
cls

load bitmap "background.bmp",0
load bitmap "F15.bmp",1

get image 1,0,0,300,300

SET CURRENT BITMAP 0

sprite 1,170,90,1

SET SPRITE 1,0,1

wait key
end

Login to post a reply

Server time is: 2024-11-13 20:06:49
Your offset time is: 2024-11-13 20:06:49