This repository demonstrates using Pillow and OpenCV to create a Pokémon game scenario generator. The application is divided into two main parts:
Allows users to edit the character's name and HP.
Continues from the first part to progressively generate multiple game scenes and create a game animation.
# Installation ```bash pip install pillow opencv-python ```- Font
font = ImageFont.truetype("Silver.ttf", 60)
- Character model pick
im = Image.open("f_w_model.jpg")
- Character HP
player1_start_XY = [976,268] # XY # main character HP left-coor
player1_end_XY = [751,268] # left
player2_start_XY = [403,63] # XY # opponent character HP left-coor
player2_end_XY = [180,63] # left
# only player1 need HP num
num_start_XY = [868,279] # left top
player1_full_blood = 20
player1_current_blood = 10
player2_full_blood = 20
player2_current_blood = 15
- Output Scenario (png)
im.save("f_w.png","png")
python T2P_PIL_finish.py
-
As mentioned above
-
animation_fps
picture_num = 50
twinkle_num = 4 # slash on/off * 2
picture_name = 0
- output folder
filename = "w_g_bb_2"
- slash twice
black = Image.open("black.jpg")
twinkle = 0
- animation
size = (1009,348) # image size
print(size)
python picture_2_movie_final.py