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 / Moving Background

Author
Message
Bio Fox
20
Years of Service
User Offline
Joined: 11th Nov 2004
Location: The BioFox Bunker
Posted: 9th Dec 2004 07:01
Does anyone know how to have the background move while a sprite says still so it simulates a scrolling screen?!?



Quote: "I don't know half of you half as well as I should like; and I like less than half of you half as well as you deserve."
- Bilbo Baggins
Bio Fox
20
Years of Service
User Offline
Joined: 11th Nov 2004
Location: The BioFox Bunker
Posted: 9th Dec 2004 07:13
Also, does anyone know how to put a darkBASIC file on my website so that people could play it?
Cookyzue
21
Years of Service
User Offline
Joined: 12th Oct 2003
Location: Who Cares?!
Posted: 9th Dec 2004 11:22 Edited at: 12th Dec 2004 13:39
well you move all the sprites that you want to move and leave the other. for example,



And for your db question, you need to build an executable of the game through db, and then you can put the exe file on your website to be downloaded.

edit; im not sure about the move sprite, i think it makes it move up. If it does you can use offset sprite and just inc the offset value for the sprites.


Current Project: Goonder Mania
MCK Games
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 9th Dec 2004 23:28 Edited at: 9th Dec 2004 23:29
You use SPRITE to move a sprite in any direction. Move sprite moves it forwards. Offset Sprite moves the datum point of the sprite.

BatVink
Bio Fox
20
Years of Service
User Offline
Joined: 11th Nov 2004
Location: The BioFox Bunker
Posted: 10th Dec 2004 05:38 Edited at: 10th Dec 2004 06:15
The if movespritesprite=nonmovable sprite# then goto no part doesn't work. Is it because I have db? Or do I need to set a sprite?




Rook Takes Pawn Productions... "Now if only we could get that accursed bishop!"
Cookyzue
21
Years of Service
User Offline
Joined: 12th Oct 2003
Location: Who Cares?!
Posted: 10th Dec 2004 09:49 Edited at: 12th Dec 2004 13:36
did you write it like
where the nonmovable sprite is the sprite you dont want to move, you need to make it a number.


Current Project: Goonder Mania
MCK Games
Bio Fox
20
Years of Service
User Offline
Joined: 11th Nov 2004
Location: The BioFox Bunker
Posted: 12th Dec 2004 08:50
It doesn't work for some reason

CODE:
Label2:
x=320
y=240
REM sync on
sprite 1,0,0,1
SIZE SPRITE 1,650,500
x= 0
y= 330
play sound 2
loop sound 2
do
rem cls
if upkey()=1 then y=y-0
if downkey()=1 then y=y+0
if leftkey()=1 then x=x-2
if rightkey()=1 then x=x+2
rem sprite 1,0,0,1
rem circle x,y,20
sprite 2, x,y,2
SIZE SPRITE 2,150,150
SET SPRITE 2,1,1

for movesprite=1 to 20
if movespritesprite=1 then goto no
if sprite exist(movesprite)
offset sprite 1,1,1
endif
no:
next movesprite
sync
loop

Rook Takes Pawn Productions... "Now if only we could get that accursed bishop!"
Cookyzue
21
Years of Service
User Offline
Joined: 12th Oct 2003
Location: Who Cares?!
Posted: 12th Dec 2004 10:55 Edited at: 12th Dec 2004 13:37
Try this:



note: i dont know if code: is part of your program or not, so i left it there.


Current Project: Goonder Mania
MCK Games
Bio Fox
20
Years of Service
User Offline
Joined: 11th Nov 2004
Location: The BioFox Bunker
Posted: 13th Dec 2004 01:24
The code offsets the sprite but it doesn't do it while the character moves.

Code:

Label2:
x=320
y=240
REM sync on
sprite 1,0,0,1
SIZE SPRITE 1,650,500
x= 0
y= 330
play sound 2
loop sound 2
do
rem cls
if upkey()=1 then y=y-0
if downkey()=1 then y=y+0
if leftkey()=1 then x=x-2
if rightkey()=1 then x=x+2

sprite 2, x,y,2
SIZE SPRITE 2,150,150
SET SPRITE 2,1,1
for movesprite=1 to 20
if movesprite=1 then goto no
if sprite exist(movesprite)
offset sprite 1,40,0

endif
no:
next movesprite
If x>640:x=0:endif
if y>0:y=330:endif
if x>0:y=330:endif
if x<0:x=0:endif
sync
loop

Rook Takes Pawn Productions... "Now if only we could get that accursed bishop!"

Login to post a reply

Server time is: 2024-11-27 16:43:51
Your offset time is: 2024-11-27 16:43:51