Wall (edge of form) Detection and movement
Heres your chance to share your own tutorials with the community. Just post them on here. If your lucky they may even be posted on the main site.
6 posts
Page 1 of 1
First add a picturebox and make sure to name it Player
then simply add this to the code (not form load :P )
Original post:http://www.dreamincode.net/forums/topic ... maze-game/
then simply add this to the code (not form load :P )
Code: Select all
Credits to : oyyou from Dreamincode Private Sub frmMain_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
'Mover Player # Option 1
Dim Loc As Point
Select Case e.KeyCode
Case Keys.A
If Not Player.Location.X - 3 < 0 Then
Loc = New Point(Player.Location.X - 5, Player.Location.Y)
Player.Location = Loc
End If
Case Keys.D
If Not Player.Location.X + 10 > Me.Width - Player.Width - 10 Then
Loc = New Point(Player.Location.X + 5, Player.Location.Y)
Player.Location = Loc
End If
Case Keys.W
If Not Player.Location.Y - 5 < 0 Then
Loc = New Point(Player.Location.X, Player.Location.Y - 5)
Player.Location = Loc
End If
Case Keys.S
If Not Player.Location.Y + 30 > Me.Height - Player.Height * 1.5 Then
Loc = New Point(Player.Location.X, Player.Location.Y + 5)
Player.Location = Loc
End If
End Select
End Sub
End Class
Original post:http://www.dreamincode.net/forums/topic ... maze-game/
Nice little snip that Snyper cooll;
Maybe i can finish my Dog Poop Game
Chris
Maybe i can finish my Dog Poop Game
Chris
hungryhounduk wrote:Nice little snip that Snyper cooll;lololoolol your WHAT!!?!?! hahaha this game sounds "interesting"
Maybe i can finish my Dog Poop Game
Chris
lololoolol your WHAT!!?!?! hahaha this game sounds "interesting"Hey
Last Year i was making a game where You (as a Dog) by Keypress (arrow Keys) move around a Park, as the Dog goes round the Park it produces POOP (PictureBox POOP) you then have double click the POOP to pick it up and do all that against a Timer cooll;
I did use a 3D Dog and the game was Played as you are Looking down from above, BUT the Issue i had was the Picturebox that the Dog iMAGE was in used to make Trails across the Image :roll: So i never figured that out, So maybe i hill hunt down my Unfinished Game and try the Code above...
Chris
hungryhounduk wrote:lololoolol your WHAT!!?!?! hahaha this game sounds "interesting"Hey
Last Year i was making a game where You (as a Dog) by Keypress (arrow Keys) move around a Park, as the Dog goes round the Park it produces POOP (PictureBox POOP) you then have double click the POOP to pick it up and do all that against a Timer cooll;
I did use a 3D Dog and the game was Played as you are Looking down from above, BUT the Issue i had was the Picturebox that the Dog iMAGE was in used to make Trails across the Image :roll: So i never figured that out, So maybe i hill hunt down my Unfinished Game and try the Code above...
Chris
ohhh sounds good make sure to upload it up to codenstuf for sure id love to play it :P
Snyper345 wrote:LOLhungryhounduk wrote:Nice little snip that Snyper cooll;lololoolol your WHAT!!?!?! hahaha this game sounds "interesting"
Maybe i can finish my Dog Poop Game
Chris
6 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023