Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
Visual Basic Forum for Visual Basic Programmers VB Forum Index » Direct X / Game Programming

Post new topic   Reply to topic
Moving Something
View previous topic :: View next topic  
Author Message
RenRu Sakamari
Newbie


Joined: 04 Aug 2005
Posts: 20
Location: Spokane, WA

PostPosted: Aug 4th, 2005 01:27 PM    Post subject: Moving Something Reply with quote

Hi, I'm having problems, and I don't even know if you can do this with VB.NET but I still want to find out.

Ok, I am making a game where you move a 2d... maybe a dot for example around the screen by using the arrow keys, but I don't know how to make it controllable by the arrow keys, could someone helpp me or give me a tip or the code to do that? Thanks.

Cameron (RenRu)
_________________
BLA<>,<>
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
RoofRabbit
Regular


Joined: 06 Jul 2005
Posts: 95
Location: Lenoir, NC USA

PostPosted: Aug 5th, 2005 11:10 PM    Post subject: Reply with quote

That would be answered better in the vb.net forum.
_________________
Website - [link]
Back to top
View user's profile Send private message Visit poster's website ICQ Number
Uarepoo2
Newbie


Joined: 02 Jul 2006
Posts: 4

PostPosted: Jul 6th, 2006 07:45 AM    Post subject: Reply with quote

If Player(MyIndex).MovingH = NO And Player(MyIndex).MovingV = NO Then
If Player(MyIndex).Dir = DIR_DOWN Then
Call SetPlayerDir(MyIndex, DIR_LEFT)
If d <> DIR_LEFT Then
Call SendPlayerDir
End If
ElseIf Player(MyIndex).Dir = DIR_LEFT Then
Call SetPlayerDir(MyIndex, DIR_UP)
If d <> DIR_UP Then
Call SendPlayerDir
End If
ElseIf Player(MyIndex).Dir = DIR_UP Then
Call SetPlayerDir(MyIndex, DIR_RIGHT)
If d <> DIR_RIGHT Then
Call SendPlayerDir
End If
ElseIf Player(MyIndex).Dir = DIR_RIGHT Then
Call SetPlayerDir(MyIndex, DIR_DOWN)
If d <> DIR_DOWN Then
Call SendPlayerDir
End If
End If
End If
End If
End Sub

Sub SetPlayerDir(ByVal Index As Long, ByVal Dir As Long)
Player(Index).Dir = Dir
End Sub

' Position
Map As Long
x As Byte
y As Byte
Dir As Byte
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Visual Basic Forum for Visual Basic Programmers VB Forum Index » Direct X / Game Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Visual Basic Forum runs phpBB | Forum Template © iOptional
VB Resources | SSL | Visual Basic