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.

DarkBASIC Discussion / Vertical Scrolling Screen for a music game

Author
Message
Zombie 20
19
Years of Service
User Offline
Joined: 26th Nov 2006
Location: Etters, PA
Posted: 14th Mar 2007 11:34
hello all, i'm developing a rythym game and i was wondering if anyone knew how to make a screen scroll, i'm sorry that i don't have any base code, Ric has showed me how to use the timer for the beats. But i'm a novice in darkbasic and don't know how to make the screen scroll. Any help would be greatly appreciated. Thank you for your time.

"To love you must want to be loved in return"
Quisco DaLuse
19
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: USA
Posted: 14th Mar 2007 14:16
Zombie 20 - It kind of depends on what you want to scroll. You could simply create sprites and move them down to create the effect of scrolling. You could also grab a large image, create a sprite and just move it down the screen. An example:



You idiots! You've captured their stunt doubles!
Zombie 20
19
Years of Service
User Offline
Joined: 26th Nov 2006
Location: Etters, PA
Posted: 14th Mar 2007 14:42
oh sorry, i guess that was a blonde moment hah! Um...the best example i can give is guitar hero, or beatmania, ddr, etc...that kind of interface

sorry for the confusion, and thank you for the code snippet

"To love you must want to be loved in return"
Zombie 20
19
Years of Service
User Offline
Joined: 26th Nov 2006
Location: Etters, PA
Posted: 17th Mar 2007 04:54
Quisco DaLuse- Thank you very much for the snippet, its been really helpful, though i do have another question, i'm sorry but i'm still a newb and learning, but i was always told you should ask for help if you need it.

Code:
get image 1,0,0,639,479
delete bitmap 1
set current bitmap 0
ink rgb(255,255,0),0
set cursor 0,450
print "Vertical Scrolling demo"
hide mouse

i was just wondering, whats going on in this section, what image are you getting and why are you deleting a bitmap?

"You can't expect to weild supreme executive power just because some watery t**t throws a bl***y sword at you..."
Zombie 20
19
Years of Service
User Offline
Joined: 26th Nov 2006
Location: Etters, PA
Posted: 17th Mar 2007 04:56
i'm sorry, you must think i'm thickheaded, i don't understand this part either, i read the code and see what you're saying, i just don't understand how it is applied. Boy, i feel dumb right now.

for i=-480 to 0 step 5
sprite 1,0,i,1
if spacekey()=1 then exit
sync
next i
set cursor 0,0

"You can't expect to weild supreme executive power just because some watery t**t throws a bl***y sword at you..."
Zombie 20
19
Years of Service
User Offline
Joined: 26th Nov 2006
Location: Etters, PA
Posted: 17th Mar 2007 09:10
actually, i'm going to experiment, its the only way i'm going to learn, so thank you for the help, i'll be alright.

"You can't expect to weild supreme executive power just because some watery t**t throws a bl***y sword at you..."
Quisco DaLuse
19
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: USA
Posted: 17th Mar 2007 16:14
Zombie 20 - You're being too hard on yourself! It's okay to ask questions - that is the only way you will learn. I think some people get upset when people simply ask questions that if they put any effort at all into it, they could obtain the info they need without asking the question (i.e. they want to be lazy and let others do the work for them while they sit back and reap the benefits)

Quote: "i was just wondering, whats going on in this section, what image are you getting and why are you deleting a bitmap?
"

The image is created to give us something to scroll vertically down the screen. Bitmap #1 is written to because we don't want to see when the random colored/sized boxes are drawn (if we drew it to bitmap #0, you would see them as they are drawn). Once everything is drawn, the entire bitmap is stored in image #1. Once this is done, we have no need of the bitmap, so it is deleted. It is good programming practice to delete bitmaps that are no longer needed.

Quote: "i don't understand this part either, i read the code and see what you're saying, i just don't understand how it is applied"


Sprite #1 is called, using image #1 (the one we just grabbed) and it's Y location at -480 makes the entire image above the visible screen. The sprite is moved in steps of five slowly down the screen. If you increased the step to say, 10, the sprite would move twice as fast down the screen. You can place sprites off the screen and slowly move them into view. It can make for nice effects.

You idiots! You've captured their stunt doubles!
Zombie 20
19
Years of Service
User Offline
Joined: 26th Nov 2006
Location: Etters, PA
Posted: 17th Mar 2007 16:38
thank you, i appreciate the time you've taken to explain this to me. I'm going to get a lot of work done today, thanks again.

"You can't expect to weild supreme executive power just because some watery t**t throws a bl***y sword at you..."

Login to post a reply

Server time is: 2026-07-06 12:11:36
Your offset time is: 2026-07-06 12:11:36