Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact


Coding a Game Character


Coding a Game Character

Author
Message
Link
Link
Forum God
Forum God (377 reputation)Forum God (377 reputation)Forum God (377 reputation)Forum God (377 reputation)Forum God (377 reputation)Forum God (377 reputation)Forum God (377 reputation)Forum God (377 reputation)Forum God (377 reputation)

Group: Forum Members
Posts: 1, Visits: 4
I know this has been asked before but I didn't get a clear enough answer. How do you code a character to move around a screen? I also want to know some good websites that have code snippets I believe there called, for rpg types of games. I've looked hours on the internet but I can't find websites that tell you these types of things.
Manku_D
Manku_D
Forum God
Forum God (2.6K reputation)Forum God (2.6K reputation)Forum God (2.6K reputation)Forum God (2.6K reputation)Forum God (2.6K reputation)Forum God (2.6K reputation)Forum God (2.6K reputation)Forum God (2.6K reputation)Forum God (2.6K reputation)

Group: Forum Members
Posts: 7, Visits: 9
Here is the simple code to move ur player in four directions ok......

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)

If KeyCode = vbKeyUp Then

 Shape1.Top = Shape1.Top - 250

end if

If KeyCode = vbKeyDown Then

 Shape1.Top = Shape1.Top + 250

end if

If KeyCode = vbKeyRight Then

 Shape1.Left = Shape1.Left + 250

end if

If KeyCode = vbKeyLeft Then

Shape1.Left = Shape1.Left - 250

end if

End Sub

U can also take any thing insted of shape1 like image or label ok hope that it helps and 250 is the speed of ur player ok.....

Bye Bye take care Manku-D

Nothing to Say.

Edited
6/29/2006 by Manku_D
DevinM
DevinM
Forum God
Forum God (9.2K reputation)Forum God (9.2K reputation)Forum God (9.2K reputation)Forum God (9.2K reputation)Forum God (9.2K reputation)Forum God (9.2K reputation)Forum God (9.2K reputation)Forum God (9.2K reputation)Forum God (9.2K reputation)

Group: Forum Members
Posts: 39, Visits: 85
I am a complete noob to the programming scene but I know another way of moving a character...

private sub form_keydown(keycode as integer, shift as integer)

select case keycode

DevinM
DevinM
Forum God
Forum God (9.2K reputation)Forum God (9.2K reputation)Forum God (9.2K reputation)Forum God (9.2K reputation)Forum God (9.2K reputation)Forum God (9.2K reputation)Forum God (9.2K reputation)Forum God (9.2K reputation)Forum God (9.2K reputation)

Group: Forum Members
Posts: 39, Visits: 85
I am a complete noob to the programming scene but I know another way of moving a character...

private sub form_keydown(keycode as integer, shift as integer)

select case keycode

         case vbkeyup

                shape.top = shape.top - (desired speed of the character)

         case vbkeyleft

                shape.left = shape.left - (desired speed of the character)

end select

This I find is easier because there is less typing ivolved and therefore less code to serach through for bugs and stuff, hope it helps.

GO


Similar Topics


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....

















A1VBCode Forums


Search