Computer Science Canada Stickman Fighting Game - How to Jump? |
Author: | Lawlly [ Tue Dec 18, 2007 12:57 pm ] | ||
Post subject: | Stickman Fighting Game - How to Jump? | ||
My friend and I have created this small stickman game. We have only basic turing knowledge and are stumped in an early stage. We don't have a clue how to make our stickpeople jump. We've managed to make them go up when you hold a key, but not a smooth motion of going up to a point and coming back down hitting a key only once. Also when you attack with one of the stickmen it freezes the entire program instead of initiating just the arm punch. Suggestions and guidance will be much appreciated. Here is our simple program: Controls: A,D, and Spacebar for player 1. Left/Right arrow keys and Numpad 0 for player 2.
|
Author: | HeavenAgain [ Tue Dec 18, 2007 1:07 pm ] |
Post subject: | RE:Stickman Fighting Game - How to Jump? |
the stick man doesnt go up because you dont have a variable to carry the y coordinate of the stick man and when you attack the program freezes because you have this Time.DelaySinceLast which causes the program to freeze for what? 0.5 seconds? at a time like this, i suggest you fork them both (attacking) by using process |
Author: | Lawlly [ Tue Dec 18, 2007 1:21 pm ] | ||
Post subject: | Re: Stickman Fighting Game - How to Jump? | ||
Well we did make our y value have a variable in our jump test program. And like I've said before, we've managed to make them go up when you hold a key, but not a smooth motion of going up to a point and coming back down when you hit a key only once. Here is our failed jump: We've managed to make them go up when you hold a key, but not a smooth motion of going up to a point and coming back down hitting a key only once.
|
Author: | HeavenAgain [ Tue Dec 18, 2007 1:42 pm ] | ||
Post subject: | RE:Stickman Fighting Game - How to Jump? | ||
instead of having it like that, you could consider something like this: have a boolean variable to check if up is pressed if pressed, then you will do a for loop of how many pixel you want to jump for example, this is what i managed to do with an oval based on your code,
![]() |