Ok, I shall look into this later. Thanks for the reply. I thought that the fact I was using text might have caused it, but was not 100% sure. I was attempting to make a medialess style'd game.
Quote: "Have you read my 2D shooting tutorial?"
Hm.. Not at the time I made that code. I purely made that code, then read the tutorial in comparison. I usually learn better that way. I honestly did not expect to be a able to make it WORKING, so I did not expect it to be perfect.
Quote: "
2. Use a timer for both the ship and bullet movement. "
Working with the timer I see, I shall do that.
Quote: "
And, to show you the difference, roughly the same thing with sprites. See if it's any smoother for you than using text:"
I ran both of them, and I see what you mean. I shall work on that when I come home from school. I gotta get ready soon. >.>
Thanks for your response TDK. I shall look into what you said later, I read it and made a quick reply, but I may have missed something, so I am going to look more into what you said when I come home.
Ok, I am working on the sprites, and I just made the ship. (Sorry if any typos, no spell check and odd keyboard, I am over at a friend's place who also has DBC [Convinced them to get it=P]) Here is the ship:
GoSub MakeSprites:
End
MakeSprites:
Ink 11507455, 0
Line 10, 1, 2, 10
Line 10, 1, 18, 10
Line 10, 1, 3, 10
Line 10, 1, 17, 10
Line 10, 1, 4, 10
Line 10, 1, 16, 10
Line 10, 1, 5, 10
Line 10, 1, 15, 10
Line 10, 1, 6, 10
Line 10, 1, 14, 10
Line 8, 5, 11, 5
Line 8, 6, 12, 6
Ink 0, 0
Box 8, 3, 11, 5
Return
I made it a GoSub code just to implement into DBC easier. Whatcha think?
Ink 16776960, 0
Box 1, 1, 2, 6
There is the bullet, mainly put it here to implement when I get home.
`Set the game up
PosX=320 : PosY=400 : Sync on : Sync Rate 60 : Hide Mouse : SheildL=400 : MaxBullets=5 : Dim FiredBullet(MaxBullets+1) : Dim BulletPosX(MaxBullets+1) : Dim BulletPosY(MaxBullets+1)
GoSub MakeSprites:
T1=Timer()
`***********
`*Main Loop*
`***********
Do
Sync
CLS
BR=Timer()-T1
BR=BR/200
If Keystate(203)=1 and PosX>=4 then PosX=PosX-5 : `Go left
If Keystate(205)=1 and PosX<=634 Then PosX=PosX+5 : `Go Right
If Keystate(42)=1 and SheildL<>0 : `If Left Shift is pressed, make a sheild
Ink 6556415, 0
CIRCLE PosX+8,406,10
SheildL=SheildL-1 : `Make Sheild
If Blah=0
CIRCLE PosX+8,406,13
Blah=1
Endif
If Blah>0
Blah=Blah+1
Endif
If Blah>3
Blah=0
Endif : `Make Flicker
Endif
Line 0, 16, SheildL/4, 16
Box 0, 14, SheildL/4, 16
Ink 16777215, 0 : `Remaining Shield Level
If Keystate(200)=1 and BR>=1
Gosub AddBullet:
Endif
If BulletCount > 0 Then Gosub MoveBullet:
Sprite 1, PosX, PosY, 1
Loop
`************
`*Procedures*
`************
MoveBullet:
For N = 2 To MaxBullets+1 : ` Move the bullets here
If FiredBullet(N)=1
BulletPosY(N)=BulletPosY(N)-20
Sprite N, BulletPosX(N),BulletPosY(N), 2
If BulletPosY(N) < -16
FiredBullet(N)=0: `Reset 'bullet currently in flight' flag
Endif
Endif
Next N
Return
AddBullet:
For N = 2 To MaxBullets+1 : `make them with ^
If FiredBullet(N)=0
FiredBullet(N)=1
BulletPosX(N) = PosX + 8
BulletPosY(N) = 400
Inc BulletCount
T1=Timer()
Exit
Endif
Next N
Return
MakeSprites:
Create Bitmap 1, 320, 200 : `Eh, nothing important, just maiing the ship and bullet
Ink 11507455, 0
Line 10, 1, 2, 10
Line 10, 1, 18, 10
Line 10, 1, 3, 10
Line 10, 1, 17, 10
Line 10, 1, 4, 10
Line 10, 1, 16, 10
Line 10, 1, 5, 10
Line 10, 1, 15, 10
Line 10, 1, 6, 10
Line 10, 1, 14, 10
Line 8, 5, 11, 5
Line 8, 6, 12, 6
Ink 0, 0
Box 8, 3, 11, 5
Get image 1, 1, 1, 20, 10
CLS
Ink 16776960, 0
Box 1, 1, 2, 6
Get Image 2, 1, 1, 10, 10
Sprite 2,-20,BulletPosY,2: Rem Place off screen as not needed yet
Set Current Bitmap 0
Delete Bitmap 1
Return
Yay! Here it is so far, I haven't put in the timer to keep speed steady, but I put in the sprites and steadied the fire rate. One question though, why does it look like 2 bullets get fired after a while?