This game, "Ninja Destiny: Chidori vs. Rasengan," is a two-player-inspired game where Naruto and Sasuke battle it out. The player (Naruto) must attack Sasuke using shurikens while avoiding hits. Sasuke moves automatically and can damage Naruto upon collision.
The game uses the pygame
library for rendering, sound effects, and game logic. Make sure to install it using:
pip install pygame
The game requires the following assets:
- Images for characters, background, and effects.
- Sound files for background music and hit effects.
photos/
├── NR1.png # Naruto's standing-right pose
├── NR2.png # Naruto's walking-right pose 1
├── NR3.png # Naruto's walking-right pose 2
├── NL1.png # Naruto's standing-left pose
├── NL2.png # Naruto's walking-left pose 1
├── NL3.png # Naruto's walking-left pose 2
├── SR1.png # Sasuke's standing-right pose
├── SR2.png # Sasuke's walking-right pose 1
├── SR3.png # Sasuke's walking-right pose 2
├── SL1.png # Sasuke's standing-left pose
├── SL2.png # Sasuke's walking-left pose 1
├── SL3.png # Sasuke's walking-left pose 2
├── Nstanding.png # Naruto's idle position
├── Nh.png # Naruto's health bar icon
├── Sh.png # Sasuke's health bar icon
├── Sd.png # Sasuke defeated image
├── Nd.png # Naruto defeated image
├── shur.png # Shuriken weapon image
├── bg.png # Background image
├── hit.wav # Hit sound effect
└── death_note.mp3 # Background music
Represents Naruto's movements, animations, and health.
- Attributes:
x
,y
: Position of Naruto.width
,height
: Size of the player sprite.speed
: Movement speed.isjump
: Boolean indicating if Naruto is jumping.jumpheight
: Height of the jump.left
,right
: Movement direction.health
: Health of Naruto.
- Methods:
draw(win)
: Renders Naruto on the screen and displays the health bar.hit()
: Reduces Naruto's health upon collision with Sasuke.
Represents shurikens Naruto throws.
- Attributes:
x
,y
: Position of the shuriken.width
,height
: Size of the shuriken.facing
: Direction of the shuriken (-1 for left, 1 for right).vel
: Velocity of the shuriken.
- Methods:
draw(win)
: Renders the shuriken.
Represents Sasuke's movements, animations, and health.
- Attributes:
x
,y
: Position of Sasuke.width
,height
: Size of the Sasuke sprite.end
: Endpoint of Sasuke's patrol path.speed
: Movement speed of Sasuke.health
: Health of Sasuke.
- Methods:
draw(win)
: Renders Sasuke on the screen and displays the health bar.move()
: Moves Sasuke between two points.hit()
: Reduces Sasuke's health when hit by a shuriken.
- Handles input for movement (
K_LEFT
,K_RIGHT
,K_UP
) and attacking (K_SPACE
). - Detects collisions between:
- Naruto and Sasuke.
- Sasuke and shurikens.
- Updates the game window and animations using the
redrawgamewindow()
function.
- Background music (
death_note.mp3
) plays continuously. - Sound effects (
hit.wav
) trigger on successful hits.
- Install
pygame
:pip install pygame
- Ensure the
photos/
folder and all required assets are in the same directory as the script. - Run the script:
python ninja_game.py
- Add Multiplayer Mode: Allow a second player to control Sasuke.
- Improve Visuals: Add advanced animations for attacks like Rasengan and Chidori.
- Power-Ups: Include items that restore health or boost speed temporarily.
- Boss Battle: Add other characters as unlockable bosses.
- High Scores: Display the winner's score at the end of the game.