Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
1
Reply
Running game C# visual studio windows form
Alvin Eka
Nov 10 2017 8:38 AM
203
Reply
i am currently making a running game for my college assingment using c# with visual studio 2011, currently i managed to make my character jump but i need to make it jump more than once can someone help me with the code?i would appreciate any kind of help
thanks
this is my code for making my player jump
in FormKeyDown
if (jump == false)
{
if (e.KeyCode == Keys.Space)
{
jump = true;
force = gravity;
}
}
in timer
if(jump)
{
player.Top -= force;
force--;
}
if(player.Top + player.Height >= screen.Height)
{
player.Top = screen.Height - player.Height;
jump = false;
}
else
{
player.Top += 1;
}
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
Issue:When we come to our newly created SPFx Solution
Game Development C# Visual Studio 2011