I just downloaded the DBdemo since i missed placed my own copy and was making a simple remake of the game Alleyway for gameboy original when i came across what seems to be a bug in the editor.
My code was working fine until i started to change the ink colors before drawing the images to be used for my sprites.
Here is my full code
hide mouse
sync on
sync rate 100
rem ----Ball Image----
ink rgb(0,150,255),1
box 0,0,10,10
get image 1,0,0,10,10
cls
ink rgb(255,100,0),1
box 0,0,20,300
get image 2,0,0,20,300
cls
box 0,0,500,20
get image 3,0,0,500,20
cls
ink rgb(0,255,0),1
box 0,0,90,10
get image 4,0,0,50,10
get image 5,0,0,70,10
get image 6,0,0,90,10
cls
rem ----Ball Sides Images----
rem ---same color as ball, the color i wanted to use---
` ink rgb(0,150,255),1
rem ---game runs properly after increasing red to 9 or greater---
` ink rgb(9,150,255),1
rem ---game runs properly after increasing green to 162 or greater, or
rem decreasing green to 129 or less---
` ink rgb(0,162,255),1
` ink rgb(0,129,255),1
rem ---game does not run properly even after decreasing blue to 0---
` ink rgb(0,150,0),1
rem ---these works---
` ink rgb(0,129,0),1
` ink rgb(0,162,0),1
rem ---this works---
` ink rgb(9,150,0),1
rem ---this works---
ink rgb(0,129,200),1
box 0,0,6,2
get image 7,0,0,6,2
cls
box 0,0,2,6
get image 8,0,0,2,6
cls
Ballx = 200
Bally = 150
BallxMove = 2
BallyMove = 2
Padx = 285
Dim PadLength(6)
PadLength(4) = 50
PadLength(5) = 70
PadLength(6) = 90
sprite 2,50,90,2
sprite 3,570,90,2
sprite 4,70,90,3
sprite 5,Padx,380,4
PadSize = 6
PadSpeed = 4
rem ====================================================
rem ==========Main Game Loop============================
rem ====================================================
Do
OldBallx = Ballx
OldBally = Bally
sprite 1,Ballx,Bally,1
sprite 6,Ballx+2,Bally-2,7
sprite 7,Ballx+10,Bally+2,8
sprite 8,Ballx+2,Bally+10,7
sprite 9,Ballx-2,Bally+2,8
Ink 1,1
box 0,0,50,200
Ink rgb(255,255,255),1
set cursor 0,0
print sprite collision(6,0)
print sprite collision(7,0)
print sprite collision(8,0)
print sprite collision(9,0)
Ballx = Ballx + BallxMove
Bally = Bally + BallyMove
If sprite collision(6,0) > 0
BallyMove = BallyMove * -1
` Ballx = OldBallx +2
Bally = OldBally +2
EndIf
If sprite collision(7,0) > 0
BallxMove = BallxMove * -1
Ballx = OldBallx -2
` Bally = OldBally -2
EndIf
If sprite collision(8,0) > 0
BallyMove = BallyMove * -1
` Ballx = OldBallx -2
Bally = OldBally -2
EndIf
If sprite collision(9,0) > 0
BallxMove = BallxMove * -1
Ballx = OldBallx +2
` Bally = OldBally +2
EndIf
sprite 5,Padx,380,PadSize
If leftkey()=1
dec Padx, PadSpeed
If Padx <= 70 then Padx = 70
EndIf
If rightkey()=1
inc Padx, PadSpeed
If Padx >= 570 - PadLength(PadSize) then Padx = 570 - PadLength(PadSize)
EndIf
If spacekey()=1 then Goto Quite_Game
sync
Loop
rem ========================================================
rem ===========End Of Main Game Loop========================
rem ========================================================
Quite_Game:
for t = 1 to 9
delete sprite t
next t
End
Not sure if this has been pointed out in the past but i thought i should share it with everyone since it gave me quite a bit of grief.
Also i would like to know if this bug occurs in DBPro.
Thanx.
Choose not a life of imitation.