http://www.SchoolFreeware.com
This tutorial will move the shooter with the arrow keys. KeyDown will be used. KeyDown is a little different than KeyPress. Also, KeyUp will be used. Some hit detection will be used to check to see if the shooter has hit the edge of the form. The hit detection will prevent the shooter from leaving the form
Amazon Auto Links: No products found.
i can only move to the right by the end of the video
how move it up or down?
Error 1 ‘Shooter’ is not declared. It may be inaccessible due to its protection level. C:Usersuserdocumentsvisual studio 2010Projectseasier game.vb 22 13 simple game
why did you use a timer to move the shooter you could put the code behind picture box
under keydown on the picture box- e.keycode right = true then picturebox1.left = picturebox1.left + 10
Private Sub Form1_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown
Select Case e.KeyCode
Case Keys.Right
TimerMain.Enabled = True
C1.Left += 9
Case Keys.Left
TimerMain.Enabled = True
C1.Left -= 9
End Select
End Sub
This is the easiest code to use
C1 is the name of the picture box
Is the timer enabled?
In the timer properties set enabled = true.
its saying Error Operator ‘-‘ is not defined for types ‘Integer’ and ‘1-dimensional array of Integer”.
On the “key up” you can just put.
SLeft = false
SRight = False
You must use Shooter.Left to move the player because Shooter.Right is read-only. To move it to the right do something like: Shooter.Left += ShooterSpeed. But, I guess you learned this a long time ago since you commented like 10 months ago.
fix it then…
hey. its giving me errors “left is not a member of Boolean ” in those two lines ‘Shooter.Left’
My VB doesnt no what a Boolean is
how can i fix this?
Nevermind I fixed it
the code ,please
What language is he using? Please reply
spelling?
Is not declared*
My shooter doesnt move 🙁
yes! it is.. is all as your video!
teemviewer for help me? 🙂
@SuperVideopeeps check to see if the timer is enabled
To me too IDK why
how can i make my shooter stop automatically after 2 seconds?
for example, startloc As New Point(0, 0)
StopLocation As New Point(150, 0)
and i want my shooter to stop at StopLocation?
sir.. maybe your speedshooter is in a boolean form…like me ^^ so i change it into integer.. 🙂 hope it help 😀
Please help me! my shooter doesnt move!
Codes: htt p: / / pastebin. co m / wZHX9QYJ
the client rectangle doent work for me i just get a its not a member of the main form error