80 likes | 252 Views
How to make a Kung-Fu game. Kung-Fu Legends In Scratch. There are two stickman fighters. You only really program one and then duplicate and change the control keys for a two-player experience. This fighter has 3 costumes: one for normal standing, the other for blocking, the third for kicking.
E N D
How to make a Kung-Fu game Kung-Fu Legends In Scratch
There are two stickman fighters.You only really program one and then duplicate and change the control keys for a two-player experience This fighter has 3 costumes: one for normal standing, the other for blocking, the third for kicking
This program keeps score of lives for each fighter, they get 10 lives in the beginning… LeftplayerLives and RightPlayerLives are variables This fighter faces right (direction=90), when space is pressed, the fighter kicks and moves forward by 10, stays like that for a short while and reverts to normal standing position. Left and Right arrow keys move the fighter left and right
Left fighter scripts continued… Pressing “b” causes the fighter to enter a block position (by switching to the block costume) Pressing “up” causes the fighter to jump and kick (“the high kick”). We go up by changing Y by 20, waiting and then coming back down by Y changing by -20 Every move broadcasts the move name to the other fighter. If the other fighter receives the broadcast of a “high kick” and they are not in the “block” position, they will lose one life…
Left fighter scripts continued 2… The other fighter, when he kicks, he broadcasts that fact to our left fighter. If they were touching when the kick was received (it’s called kickback to make it different from the left fighter’s kicks) the left fighter loses a life.
Right fighter scripts – all of them. You can see they are very similar Notice, the right fighter has to respond to other keys
The announcement when the right player has no more lives left When the program starts ,this announcement is invisible (ghost=100%), but it comes up and becomes visible when needed (ghost=0%)…
Good luck! • Extension activities: • More moves • Ninja disks? • Bounce off walls? • Breathe fire? • Cast spells? • Take their swords out? • Headbutting? • If you don’t want to make a kung-fu game, you can make this fighter go against pacman monsters, etc.