Mario Jumping
Mario Jumping
Mario Jumping
Mario Jumping
Mario Jumping
Mario Jumping Mario Jumping Mario Jumping Mario Jumping Mario Jumping Mario Jumping Mario Jumping Mario Jumping
Mario Jumping Mario Jumping
Mario Jumping
Go Back  Xtreme Visual Basic Talk > > > Mario Jumping


Reply
 
Thread Tools Display Modes
  #1  
Old 03-17-2010, 05:27 AM
Jayzee64 Jayzee64 is offline
Newcomer
 
Join Date: Jan 2010
Posts: 2
Default Mario Jumping


I have managed to successfully make Mario jump but once he lands and i still have my key down for jumping he will keep jumping.

I was wondering if there is a work around, so that if you have to let go of the key before you can jump again. To get the Key im using a event handler then using the term "If (GetKeyState(vbKeyA) And KEY_PRESSED)"
Reply With Quote
  #2  
Old 03-17-2010, 08:47 AM
FireBot FireBot is offline
Centurion
 
Join Date: Mar 2008
Posts: 100
Default

I'd suggest a timer. The timer control works.

I'd suggest you have a jump acceleration component. While the key is pressed, keep applying this. When released it ceases adding it. This will give the classic Mario tiny-jump and big-jump difference from how long you hold the button down.

Basically the KeyDown can set:
If (JumpButton = False) and (GetKeyState(vbKeyA) And KEY_PRESSED) then
JumpButton = True
DoJump = True
End If

And some KeyUp code:
JumpButton = False
DoJump = False

Then in a 'timer'(or your game loop):
Do While DoJump
'add the jump acceleration
DoJump = False 'when mario has reached the max height or whatever
Loop
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Mario Jumping
Mario Jumping
Mario Jumping Mario Jumping
Mario Jumping
Mario Jumping
Mario Jumping Mario Jumping Mario Jumping Mario Jumping Mario Jumping Mario Jumping Mario Jumping
Mario Jumping
Mario Jumping
 
Mario Jumping
Mario Jumping
 
-->