A1VBCode Forums

Coding a Game Character


http://a1vbcode.com/vbforums/Topic19208.aspx

By Link - 6/19/2006

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.
By DevinM - 4/25/2007

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.