diff --git a/resources/graphics/Bullets/BulletMushRoom/BulletMushRoom_0.png b/resources/graphics/Bullets/BulletMushRoom/BulletMushRoom_0.png new file mode 100644 index 0000000..cc30098 Binary files /dev/null and b/resources/graphics/Bullets/BulletMushRoom/BulletMushRoom_0.png differ diff --git a/resources/graphics/Bullets/BulletMushRoom/BulletMushRoom_1.png b/resources/graphics/Bullets/BulletMushRoom/BulletMushRoom_1.png new file mode 100644 index 0000000..7be281e Binary files /dev/null and b/resources/graphics/Bullets/BulletMushRoom/BulletMushRoom_1.png differ diff --git a/resources/graphics/Bullets/BulletMushRoom/BulletMushRoom_2.png b/resources/graphics/Bullets/BulletMushRoom/BulletMushRoom_2.png new file mode 100644 index 0000000..bde311e Binary files /dev/null and b/resources/graphics/Bullets/BulletMushRoom/BulletMushRoom_2.png differ diff --git a/resources/graphics/Bullets/BulletMushRoom/BulletMushRoom_3.png b/resources/graphics/Bullets/BulletMushRoom/BulletMushRoom_3.png new file mode 100644 index 0000000..e354eee Binary files /dev/null and b/resources/graphics/Bullets/BulletMushRoom/BulletMushRoom_3.png differ diff --git a/resources/graphics/Bullets/BulletMushRoom/BulletMushRoom_4.png b/resources/graphics/Bullets/BulletMushRoom/BulletMushRoom_4.png new file mode 100644 index 0000000..b3355bc Binary files /dev/null and b/resources/graphics/Bullets/BulletMushRoom/BulletMushRoom_4.png differ diff --git a/resources/graphics/Bullets/BulletMushRoomExplode/BulletMushRoomExplode_0.gif b/resources/graphics/Bullets/BulletMushRoomExplode/BulletMushRoomExplode_0.gif new file mode 100644 index 0000000..0d6a7b4 Binary files /dev/null and b/resources/graphics/Bullets/BulletMushRoomExplode/BulletMushRoomExplode_0.gif differ diff --git a/resources/graphics/Cards/card_puffmushroom.png b/resources/graphics/Cards/card_puffmushroom.png new file mode 100644 index 0000000..6a52f76 Binary files /dev/null and b/resources/graphics/Cards/card_puffmushroom.png differ diff --git a/resources/graphics/Plants/PuffMushroom/PuffMushroom_0.png b/resources/graphics/Plants/PuffMushroom/PuffMushroom_0.png new file mode 100644 index 0000000..a15e8fa Binary files /dev/null and b/resources/graphics/Plants/PuffMushroom/PuffMushroom_0.png differ diff --git a/resources/graphics/Plants/PuffMushroom/PuffMushroom_1.png b/resources/graphics/Plants/PuffMushroom/PuffMushroom_1.png new file mode 100644 index 0000000..69b3d33 Binary files /dev/null and b/resources/graphics/Plants/PuffMushroom/PuffMushroom_1.png differ diff --git a/resources/graphics/Plants/PuffMushroom/PuffMushroom_10.png b/resources/graphics/Plants/PuffMushroom/PuffMushroom_10.png new file mode 100644 index 0000000..4d2f35a Binary files /dev/null and b/resources/graphics/Plants/PuffMushroom/PuffMushroom_10.png differ diff --git a/resources/graphics/Plants/PuffMushroom/PuffMushroom_11.png b/resources/graphics/Plants/PuffMushroom/PuffMushroom_11.png new file mode 100644 index 0000000..ab68e0b Binary files /dev/null and b/resources/graphics/Plants/PuffMushroom/PuffMushroom_11.png differ diff --git a/resources/graphics/Plants/PuffMushroom/PuffMushroom_12.png b/resources/graphics/Plants/PuffMushroom/PuffMushroom_12.png new file mode 100644 index 0000000..aad893a Binary files /dev/null and b/resources/graphics/Plants/PuffMushroom/PuffMushroom_12.png differ diff --git a/resources/graphics/Plants/PuffMushroom/PuffMushroom_13.png b/resources/graphics/Plants/PuffMushroom/PuffMushroom_13.png new file mode 100644 index 0000000..bc28b53 Binary files /dev/null and b/resources/graphics/Plants/PuffMushroom/PuffMushroom_13.png differ diff --git a/resources/graphics/Plants/PuffMushroom/PuffMushroom_2.png b/resources/graphics/Plants/PuffMushroom/PuffMushroom_2.png new file mode 100644 index 0000000..35ae8ef Binary files /dev/null and b/resources/graphics/Plants/PuffMushroom/PuffMushroom_2.png differ diff --git a/resources/graphics/Plants/PuffMushroom/PuffMushroom_3.png b/resources/graphics/Plants/PuffMushroom/PuffMushroom_3.png new file mode 100644 index 0000000..33a971d Binary files /dev/null and b/resources/graphics/Plants/PuffMushroom/PuffMushroom_3.png differ diff --git a/resources/graphics/Plants/PuffMushroom/PuffMushroom_4.png b/resources/graphics/Plants/PuffMushroom/PuffMushroom_4.png new file mode 100644 index 0000000..01f4466 Binary files /dev/null and b/resources/graphics/Plants/PuffMushroom/PuffMushroom_4.png differ diff --git a/resources/graphics/Plants/PuffMushroom/PuffMushroom_5.png b/resources/graphics/Plants/PuffMushroom/PuffMushroom_5.png new file mode 100644 index 0000000..0abcb46 Binary files /dev/null and b/resources/graphics/Plants/PuffMushroom/PuffMushroom_5.png differ diff --git a/resources/graphics/Plants/PuffMushroom/PuffMushroom_6.png b/resources/graphics/Plants/PuffMushroom/PuffMushroom_6.png new file mode 100644 index 0000000..2651435 Binary files /dev/null and b/resources/graphics/Plants/PuffMushroom/PuffMushroom_6.png differ diff --git a/resources/graphics/Plants/PuffMushroom/PuffMushroom_7.png b/resources/graphics/Plants/PuffMushroom/PuffMushroom_7.png new file mode 100644 index 0000000..d415195 Binary files /dev/null and b/resources/graphics/Plants/PuffMushroom/PuffMushroom_7.png differ diff --git a/resources/graphics/Plants/PuffMushroom/PuffMushroom_8.png b/resources/graphics/Plants/PuffMushroom/PuffMushroom_8.png new file mode 100644 index 0000000..d415195 Binary files /dev/null and b/resources/graphics/Plants/PuffMushroom/PuffMushroom_8.png differ diff --git a/resources/graphics/Plants/PuffMushroom/PuffMushroom_9.png b/resources/graphics/Plants/PuffMushroom/PuffMushroom_9.png new file mode 100644 index 0000000..512436d Binary files /dev/null and b/resources/graphics/Plants/PuffMushroom/PuffMushroom_9.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_0.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_0.png new file mode 100644 index 0000000..5c4a0d7 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_0.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_1.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_1.png new file mode 100644 index 0000000..8728499 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_1.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_10.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_10.png new file mode 100644 index 0000000..036e17d Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_10.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_11.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_11.png new file mode 100644 index 0000000..eca85e6 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_11.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_12.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_12.png new file mode 100644 index 0000000..b2fc8b4 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_12.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_13.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_13.png new file mode 100644 index 0000000..3c135ec Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_13.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_14.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_14.png new file mode 100644 index 0000000..76762ed Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_14.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_15.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_15.png new file mode 100644 index 0000000..881f5ea Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_15.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_16.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_16.png new file mode 100644 index 0000000..f32cf63 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_16.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_17.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_17.png new file mode 100644 index 0000000..928c72e Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_17.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_18.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_18.png new file mode 100644 index 0000000..2cdc992 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_18.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_2.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_2.png new file mode 100644 index 0000000..f14938c Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_2.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_3.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_3.png new file mode 100644 index 0000000..5b430a2 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_3.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_4.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_4.png new file mode 100644 index 0000000..a5c8a0a Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_4.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_5.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_5.png new file mode 100644 index 0000000..985c91e Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_5.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_6.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_6.png new file mode 100644 index 0000000..c75546e Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_6.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_7.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_7.png new file mode 100644 index 0000000..e3b7359 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_7.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_8.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_8.png new file mode 100644 index 0000000..70a66aa Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_8.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_9.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_9.png new file mode 100644 index 0000000..b75e2b7 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombie/NewspaperZombie_9.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieAttack/NewspaperZombieAttack_0.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieAttack/NewspaperZombieAttack_0.png new file mode 100644 index 0000000..2d1f097 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieAttack/NewspaperZombieAttack_0.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieAttack/NewspaperZombieAttack_1.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieAttack/NewspaperZombieAttack_1.png new file mode 100644 index 0000000..495bd20 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieAttack/NewspaperZombieAttack_1.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieAttack/NewspaperZombieAttack_2.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieAttack/NewspaperZombieAttack_2.png new file mode 100644 index 0000000..9f92dde Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieAttack/NewspaperZombieAttack_2.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieAttack/NewspaperZombieAttack_3.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieAttack/NewspaperZombieAttack_3.png new file mode 100644 index 0000000..eee0cfd Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieAttack/NewspaperZombieAttack_3.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieAttack/NewspaperZombieAttack_4.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieAttack/NewspaperZombieAttack_4.png new file mode 100644 index 0000000..05928f7 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieAttack/NewspaperZombieAttack_4.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieAttack/NewspaperZombieAttack_5.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieAttack/NewspaperZombieAttack_5.png new file mode 100644 index 0000000..84a381e Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieAttack/NewspaperZombieAttack_5.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieAttack/NewspaperZombieAttack_6.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieAttack/NewspaperZombieAttack_6.png new file mode 100644 index 0000000..1945970 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieAttack/NewspaperZombieAttack_6.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieAttack/NewspaperZombieAttack_7.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieAttack/NewspaperZombieAttack_7.png new file mode 100644 index 0000000..7c2e88c Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieAttack/NewspaperZombieAttack_7.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieDie/NewspaperZombieDie_0.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieDie/NewspaperZombieDie_0.png new file mode 100644 index 0000000..4a033e7 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieDie/NewspaperZombieDie_0.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieDie/NewspaperZombieDie_1.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieDie/NewspaperZombieDie_1.png new file mode 100644 index 0000000..df80a35 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieDie/NewspaperZombieDie_1.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieDie/NewspaperZombieDie_10.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieDie/NewspaperZombieDie_10.png new file mode 100644 index 0000000..e5c7583 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieDie/NewspaperZombieDie_10.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieDie/NewspaperZombieDie_2.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieDie/NewspaperZombieDie_2.png new file mode 100644 index 0000000..5269fdf Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieDie/NewspaperZombieDie_2.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieDie/NewspaperZombieDie_3.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieDie/NewspaperZombieDie_3.png new file mode 100644 index 0000000..033ecc6 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieDie/NewspaperZombieDie_3.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieDie/NewspaperZombieDie_4.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieDie/NewspaperZombieDie_4.png new file mode 100644 index 0000000..033ecc6 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieDie/NewspaperZombieDie_4.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieDie/NewspaperZombieDie_5.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieDie/NewspaperZombieDie_5.png new file mode 100644 index 0000000..09f6f39 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieDie/NewspaperZombieDie_5.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieDie/NewspaperZombieDie_6.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieDie/NewspaperZombieDie_6.png new file mode 100644 index 0000000..21374dd Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieDie/NewspaperZombieDie_6.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieDie/NewspaperZombieDie_7.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieDie/NewspaperZombieDie_7.png new file mode 100644 index 0000000..a486ee6 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieDie/NewspaperZombieDie_7.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieDie/NewspaperZombieDie_8.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieDie/NewspaperZombieDie_8.png new file mode 100644 index 0000000..a486ee6 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieDie/NewspaperZombieDie_8.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieDie/NewspaperZombieDie_9.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieDie/NewspaperZombieDie_9.png new file mode 100644 index 0000000..0dbe4f4 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieDie/NewspaperZombieDie_9.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHead/NewspaperZombieLostHead_0.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHead/NewspaperZombieLostHead_0.png new file mode 100644 index 0000000..f6414a9 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHead/NewspaperZombieLostHead_0.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHead/NewspaperZombieLostHead_1.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHead/NewspaperZombieLostHead_1.png new file mode 100644 index 0000000..f6414a9 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHead/NewspaperZombieLostHead_1.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHead/NewspaperZombieLostHead_10.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHead/NewspaperZombieLostHead_10.png new file mode 100644 index 0000000..0669d43 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHead/NewspaperZombieLostHead_10.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHead/NewspaperZombieLostHead_11.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHead/NewspaperZombieLostHead_11.png new file mode 100644 index 0000000..bcca03b Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHead/NewspaperZombieLostHead_11.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHead/NewspaperZombieLostHead_12.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHead/NewspaperZombieLostHead_12.png new file mode 100644 index 0000000..4c12286 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHead/NewspaperZombieLostHead_12.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHead/NewspaperZombieLostHead_13.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHead/NewspaperZombieLostHead_13.png new file mode 100644 index 0000000..c550703 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHead/NewspaperZombieLostHead_13.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHead/NewspaperZombieLostHead_14.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHead/NewspaperZombieLostHead_14.png new file mode 100644 index 0000000..b24872b Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHead/NewspaperZombieLostHead_14.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHead/NewspaperZombieLostHead_15.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHead/NewspaperZombieLostHead_15.png new file mode 100644 index 0000000..c64ab01 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHead/NewspaperZombieLostHead_15.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHead/NewspaperZombieLostHead_2.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHead/NewspaperZombieLostHead_2.png new file mode 100644 index 0000000..a149ca9 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHead/NewspaperZombieLostHead_2.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHead/NewspaperZombieLostHead_3.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHead/NewspaperZombieLostHead_3.png new file mode 100644 index 0000000..185d297 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHead/NewspaperZombieLostHead_3.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHead/NewspaperZombieLostHead_4.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHead/NewspaperZombieLostHead_4.png new file mode 100644 index 0000000..ba47540 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHead/NewspaperZombieLostHead_4.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHead/NewspaperZombieLostHead_5.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHead/NewspaperZombieLostHead_5.png new file mode 100644 index 0000000..3a86a12 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHead/NewspaperZombieLostHead_5.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHead/NewspaperZombieLostHead_6.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHead/NewspaperZombieLostHead_6.png new file mode 100644 index 0000000..e3beb84 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHead/NewspaperZombieLostHead_6.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHead/NewspaperZombieLostHead_7.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHead/NewspaperZombieLostHead_7.png new file mode 100644 index 0000000..2f85a78 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHead/NewspaperZombieLostHead_7.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHead/NewspaperZombieLostHead_8.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHead/NewspaperZombieLostHead_8.png new file mode 100644 index 0000000..e24c104 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHead/NewspaperZombieLostHead_8.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHead/NewspaperZombieLostHead_9.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHead/NewspaperZombieLostHead_9.png new file mode 100644 index 0000000..87429e1 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHead/NewspaperZombieLostHead_9.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHeadAttack/NewspaperZombieLostHeadAttack_0.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHeadAttack/NewspaperZombieLostHeadAttack_0.png new file mode 100644 index 0000000..1720cd9 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHeadAttack/NewspaperZombieLostHeadAttack_0.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHeadAttack/NewspaperZombieLostHeadAttack_1.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHeadAttack/NewspaperZombieLostHeadAttack_1.png new file mode 100644 index 0000000..3689fab Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHeadAttack/NewspaperZombieLostHeadAttack_1.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHeadAttack/NewspaperZombieLostHeadAttack_2.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHeadAttack/NewspaperZombieLostHeadAttack_2.png new file mode 100644 index 0000000..ed0303f Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHeadAttack/NewspaperZombieLostHeadAttack_2.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHeadAttack/NewspaperZombieLostHeadAttack_3.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHeadAttack/NewspaperZombieLostHeadAttack_3.png new file mode 100644 index 0000000..795e932 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHeadAttack/NewspaperZombieLostHeadAttack_3.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHeadAttack/NewspaperZombieLostHeadAttack_4.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHeadAttack/NewspaperZombieLostHeadAttack_4.png new file mode 100644 index 0000000..deafa99 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHeadAttack/NewspaperZombieLostHeadAttack_4.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHeadAttack/NewspaperZombieLostHeadAttack_5.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHeadAttack/NewspaperZombieLostHeadAttack_5.png new file mode 100644 index 0000000..280c177 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHeadAttack/NewspaperZombieLostHeadAttack_5.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHeadAttack/NewspaperZombieLostHeadAttack_6.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHeadAttack/NewspaperZombieLostHeadAttack_6.png new file mode 100644 index 0000000..f2b9a31 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieLostHeadAttack/NewspaperZombieLostHeadAttack_6.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaper/NewspaperZombieNoPaper_0.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaper/NewspaperZombieNoPaper_0.png new file mode 100644 index 0000000..c7e638a Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaper/NewspaperZombieNoPaper_0.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaper/NewspaperZombieNoPaper_1.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaper/NewspaperZombieNoPaper_1.png new file mode 100644 index 0000000..492e147 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaper/NewspaperZombieNoPaper_1.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaper/NewspaperZombieNoPaper_10.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaper/NewspaperZombieNoPaper_10.png new file mode 100644 index 0000000..e00f961 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaper/NewspaperZombieNoPaper_10.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaper/NewspaperZombieNoPaper_11.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaper/NewspaperZombieNoPaper_11.png new file mode 100644 index 0000000..31e0e52 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaper/NewspaperZombieNoPaper_11.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaper/NewspaperZombieNoPaper_12.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaper/NewspaperZombieNoPaper_12.png new file mode 100644 index 0000000..a25e90e Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaper/NewspaperZombieNoPaper_12.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaper/NewspaperZombieNoPaper_13.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaper/NewspaperZombieNoPaper_13.png new file mode 100644 index 0000000..7776e8a Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaper/NewspaperZombieNoPaper_13.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaper/NewspaperZombieNoPaper_2.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaper/NewspaperZombieNoPaper_2.png new file mode 100644 index 0000000..c2584a6 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaper/NewspaperZombieNoPaper_2.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaper/NewspaperZombieNoPaper_3.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaper/NewspaperZombieNoPaper_3.png new file mode 100644 index 0000000..b274f75 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaper/NewspaperZombieNoPaper_3.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaper/NewspaperZombieNoPaper_4.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaper/NewspaperZombieNoPaper_4.png new file mode 100644 index 0000000..a3a36f0 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaper/NewspaperZombieNoPaper_4.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaper/NewspaperZombieNoPaper_5.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaper/NewspaperZombieNoPaper_5.png new file mode 100644 index 0000000..1c99706 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaper/NewspaperZombieNoPaper_5.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaper/NewspaperZombieNoPaper_6.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaper/NewspaperZombieNoPaper_6.png new file mode 100644 index 0000000..efcc493 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaper/NewspaperZombieNoPaper_6.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaper/NewspaperZombieNoPaper_7.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaper/NewspaperZombieNoPaper_7.png new file mode 100644 index 0000000..3496cf5 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaper/NewspaperZombieNoPaper_7.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaper/NewspaperZombieNoPaper_8.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaper/NewspaperZombieNoPaper_8.png new file mode 100644 index 0000000..666b106 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaper/NewspaperZombieNoPaper_8.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaper/NewspaperZombieNoPaper_9.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaper/NewspaperZombieNoPaper_9.png new file mode 100644 index 0000000..252c33d Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaper/NewspaperZombieNoPaper_9.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaperAttack/NewspaperZombieNoPaperAttack_0.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaperAttack/NewspaperZombieNoPaperAttack_0.png new file mode 100644 index 0000000..60d9298 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaperAttack/NewspaperZombieNoPaperAttack_0.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaperAttack/NewspaperZombieNoPaperAttack_1.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaperAttack/NewspaperZombieNoPaperAttack_1.png new file mode 100644 index 0000000..3020387 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaperAttack/NewspaperZombieNoPaperAttack_1.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaperAttack/NewspaperZombieNoPaperAttack_2.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaperAttack/NewspaperZombieNoPaperAttack_2.png new file mode 100644 index 0000000..7151681 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaperAttack/NewspaperZombieNoPaperAttack_2.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaperAttack/NewspaperZombieNoPaperAttack_3.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaperAttack/NewspaperZombieNoPaperAttack_3.png new file mode 100644 index 0000000..0ab9bfe Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaperAttack/NewspaperZombieNoPaperAttack_3.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaperAttack/NewspaperZombieNoPaperAttack_4.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaperAttack/NewspaperZombieNoPaperAttack_4.png new file mode 100644 index 0000000..e4b8ff5 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaperAttack/NewspaperZombieNoPaperAttack_4.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaperAttack/NewspaperZombieNoPaperAttack_5.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaperAttack/NewspaperZombieNoPaperAttack_5.png new file mode 100644 index 0000000..f603e86 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaperAttack/NewspaperZombieNoPaperAttack_5.png differ diff --git a/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaperAttack/NewspaperZombieNoPaperAttack_6.png b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaperAttack/NewspaperZombieNoPaperAttack_6.png new file mode 100644 index 0000000..d3c28b4 Binary files /dev/null and b/resources/graphics/Zombies/NewspaperZombie/NewspaperZombieNoPaperAttack/NewspaperZombieNoPaperAttack_6.png differ diff --git a/source/component/map.py b/source/component/map.py index acd0718..0de0eda 100644 --- a/source/component/map.py +++ b/source/component/map.py @@ -26,7 +26,7 @@ class Map(): return (x // c.GRID_X_SIZE, y // c.GRID_Y_SIZE) def getMapGridPos(self, map_x, map_y): - return (map_x * c.GRID_X_SIZE + c.GRID_X_SIZE//8 + c.MAP_OFFSET_X, + return (map_x * c.GRID_X_SIZE + c.GRID_X_SIZE//2 + c.MAP_OFFSET_X, map_y * c.GRID_Y_SIZE + c.GRID_Y_SIZE//5 * 3 + c.MAP_OFFSET_Y) def setMapGridType(self, map_x, map_y, type): diff --git a/source/component/menubar.py b/source/component/menubar.py index 6d114a7..21222ce 100644 --- a/source/component/menubar.py +++ b/source/component/menubar.py @@ -5,11 +5,14 @@ from .. import tool from .. import constants as c card_name_list = [c.CARD_SUNFLOWER, c.CARD_PEASHOOTER, c.CARD_SNOWPEASHOOTER, c.CARD_WALLNUT, - c.CARD_CHERRYBOMB, c.CARD_THREEPEASHOOTER, c.CARD_REPEATERPEA, c.CARD_CHOMPER] + c.CARD_CHERRYBOMB, c.CARD_THREEPEASHOOTER, c.CARD_REPEATERPEA, c.CARD_CHOMPER, + c.CARD_PUFFMUSHROOM] plant_name_list = [c.SUNFLOWER, c.PEASHOOTER, c.SNOWPEASHOOTER, c.WALLNUT, - c.CHERRYBOMB, c.THREEPEASHOOTER, c.REPEATERPEA, c.CHOMPER] -plant_sun_list = [50, 100, 175, 50, 150, 325, 200, 150] -card_list = [0, 1, 2, 3, 4, 5, 7] + c.CHERRYBOMB, c.THREEPEASHOOTER, c.REPEATERPEA, c.CHOMPER, + c.PUFFMUSHROOM] +plant_sun_list = [50, 100, 175, 50, 150, 325, 200, 150, 0] +plant_frozen_time_list = [0, 0, 0, 0, 0, 0, 0, 0, 8000] +card_list = [0, 1, 2, 3, 4, 8, 7] class Card(): def __init__(self, x, y, name_index): @@ -20,6 +23,8 @@ class Card(): self.name_index = name_index self.sun_cost = plant_sun_list[name_index] + self.frozen_time = plant_frozen_time_list[name_index] + self.frozen_timer = -self.frozen_time def loadFrame(self, name): frame = tool.GFX[name] @@ -35,6 +40,21 @@ class Card(): return True return False + def canClick(self, sun_value, current_time): + if self.sun_cost <= sun_value and (current_time - self.frozen_timer) > self.frozen_time: + return True + return False + + def setFrozenTime(self, current_time): + self.frozen_timer = current_time + + def update(self, sun_value, current_time): + if (self.sun_cost > sun_value or + (current_time - self.frozen_timer) <= self.frozen_time): + self.image.set_alpha(128) + else: + self.image.set_alpha(255) + def draw(self, surface): surface.blit(self.image, self.rect) @@ -58,6 +78,11 @@ class MenuBar(): self.image = tool.get_image(tool.GFX[name], *frame_rect, c.BLACK, 0.8) + def update(self, current_time): + self.current_time = current_time + for card in self.card_list: + card.update(self.sun_value, self.current_time) + def createImage(self, x, y, num): if num == 1: return @@ -86,7 +111,7 @@ class MenuBar(): result = None for card in self.card_list: if card.checkMouseClick(mouse_pos): - if card.sun_cost <= self.sun_value: + if card.canClick(self.sun_value, self.current_time): result = (plant_name_list[card.name_index], card.sun_cost) break return result @@ -103,7 +128,13 @@ class MenuBar(): def increaseSunValue(self, value): self.sun_value += value - + + def setCardFrozenTime(self, plant_name): + for card in self.card_list: + if plant_name_list[card.name_index] == plant_name: + card.setFrozenTime(self.current_time) + break + def drawSunValue(self): width = 30 msg_image = self.font.render(str(self.sun_value), True, c.NAVYBLUE, c.LIGHTYELLOW) diff --git a/source/component/plant.py b/source/component/plant.py index a179cfe..6498538 100644 --- a/source/component/plant.py +++ b/source/component/plant.py @@ -44,7 +44,7 @@ class Bullet(pg.sprite.Sprite): self.load_images() self.image = self.frames[self.frame_index] self.rect = self.image.get_rect() - self.rect.x = x - 50 + self.rect.x = x self.rect.y = start_y self.dest_y = dest_y self.y_vel = 4 if (dest_y > start_y) else -4 @@ -56,18 +56,26 @@ class Bullet(pg.sprite.Sprite): def loadFrames(self, frames, name): frame_list = tool.GFX[name] - rect = frame_list[0].get_rect() - width, height = rect.w, rect.h + if name in tool.PLANT_RECT: + data = tool.PLANT_RECT[name] + x, y, width, height = data['x'], data['y'], data['width'], data['height'] + else: + x, y = 0, 0 + rect = frame_list[0].get_rect() + width, height = rect.w, rect.h for frame in frame_list: - frames.append(tool.get_image(frame, 0, 0, width, height)) + frames.append(tool.get_image(frame, x, y, width, height)) def load_images(self): self.fly_frames = [] self.explode_frames = [] fly_name = self.name - explode_name = 'PeaNormalExplode' + if self.name == c.BULLET_MUSHROOM: + explode_name = 'BulletMushRoomExplode' + else: + explode_name = 'PeaNormalExplode' self.loadFrames(self.fly_frames, fly_name) self.loadFrames(self.explode_frames, explode_name) @@ -118,17 +126,18 @@ class Plant(pg.sprite.Sprite): self.animate_interval = 100 self.is_attacked = False - def loadFrames(self, frames, name, scale, frame_rect=None): + def loadFrames(self, frames, name, scale): frame_list = tool.GFX[name] - if frame_rect == None: + if name in tool.PLANT_RECT: + data = tool.PLANT_RECT[name] + x, y, width, height = data['x'], data['y'], data['width'], data['height'] + else: x, y = 0, 0 rect = frame_list[0].get_rect() width, height = rect.w, rect.h - else: - x, y, width, height = frame_rect[0], frame_rect[1], frame_rect[2], frame_rect[3] for frame in frame_list: - frames.append(tool.get_image(frame, 0, 0, width, height, c.BLACK, scale)) + frames.append(tool.get_image(frame, x, y, width, height, c.BLACK, scale)) def loadImages(self, name, scale): self.loadFrames(self.frames, name, scale) @@ -169,7 +178,12 @@ class Plant(pg.sprite.Sprite): self.animate_timer = self.current_time self.image = self.frames[self.frame_index] - + + def canAttack(self, zombie): + if (self.rect.x <= zombie.rect.right): + return True + return False + def setAttack(self): pass @@ -382,7 +396,7 @@ class Chomper(Plant): rect_list = [(0, 0, 100, 114), None, None] for i, name in enumerate(name_list): - self.loadFrames(frame_list[i], name, scale_list[i], rect_list[i]) + self.loadFrames(frame_list[i], name, scale_list[i]) self.frames = self.idle_frames @@ -433,3 +447,26 @@ class Chomper(Plant): self.rect = self.image.get_rect() self.rect.bottom = bottom self.rect.x = x + +class PuffMushroom(Plant): + def __init__(self, x, y, bullet_group): + Plant.__init__(self, x, y, c.PUFFMUSHROOM, c.PLANT_HEALTH, bullet_group) + self.shoot_timer = 0 + + def loadImages(self, name, scale): + self.loadFrames(self.frames, name, 1) + + def attacking(self): + if (self.current_time - self.shoot_timer) > 3000: + self.bullet_group.add(Bullet(self.rect.right, self.rect.y, self.rect.y, + c.BULLET_MUSHROOM, c.BULLET_DAMAGE_NORMAL, True)) + self.shoot_timer = self.current_time + + def canAttack(self, zombie): + if (self.rect.x <= zombie.rect.right and + (self.rect.right + c.GRID_X_SIZE * 4 >= zombie.rect.x)): + return True + return False + + def setAttack(self): + self.state = c.ATTACK \ No newline at end of file diff --git a/source/component/zombie.py b/source/component/zombie.py index 45c47f3..c89f6cc 100644 --- a/source/component/zombie.py +++ b/source/component/zombie.py @@ -33,15 +33,16 @@ class Zombie(pg.sprite.Sprite): self.animate_interval = 150 self.ice_slow_ratio = 1 self.ice_slow_timer = 0 + self.speed_ratio = 1 - def loadFrames(self, frames, name, image_x): + def loadFrames(self, frames, name, image_x, colorkey=c.BLACK): frame_list = tool.GFX[name] rect = frame_list[0].get_rect() width, height = rect.w, rect.h width -= image_x for frame in frame_list: - frames.append(tool.get_image(frame, image_x, 0, width, height)) + frames.append(tool.get_image(frame, image_x, 0, width, height, colorkey)) def update(self, game_info): self.current_time = game_info[c.CURRENT_TIME] @@ -66,8 +67,10 @@ class Zombie(pg.sprite.Sprite): elif self.health <= c.NORMAL_HEALTH and self.helmet: self.changeFrames(self.walk_frames) self.helmet = False - - if (self.current_time - self.walk_timer) > (c.ZOMBIE_WALK_INTERVAL * self.ice_slow_ratio): + if self.name == c.NEWSPAPER_ZOMBIE: + self.speed_ratio = 0.5 + + if (self.current_time - self.walk_timer) > (c.ZOMBIE_WALK_INTERVAL * self.getTimeRatio()): self.walk_timer = self.current_time self.rect.x -= 1 @@ -77,7 +80,7 @@ class Zombie(pg.sprite.Sprite): elif self.health <= c.LOSTHEAD_HEALTH and not self.losHead: self.changeFrames(self.losthead_attack_frames) self.setLostHead() - if (self.current_time - self.attack_timer) > (c.ATTACK_INTERVAL * self.ice_slow_ratio): + if (self.current_time - self.attack_timer) > (c.ATTACK_INTERVAL * self.getTimeRatio()): self.plant.setDamage(self.damage) self.attack_timer = self.current_time @@ -107,7 +110,7 @@ class Zombie(pg.sprite.Sprite): self.rect.centerx = centerx def animation(self): - if (self.current_time - self.animate_timer) > (self.animate_interval * self.ice_slow_ratio): + if (self.current_time - self.animate_timer) > (self.animate_interval * self.getTimeRatio()): self.frame_index += 1 if self.frame_index >= self.frame_num: if self.state == c.DIE: @@ -117,7 +120,10 @@ class Zombie(pg.sprite.Sprite): self.animate_timer = self.current_time self.image = self.frames[self.frame_index] - + + def getTimeRatio(self): + return self.ice_slow_ratio * self.speed_ratio + def setIceSlow(self): '''when get a ice bullet damage, slow the attack or walk speed of the zombie''' self.ice_slow_timer = self.current_time @@ -308,4 +314,40 @@ class FlagZombie(Zombie): for i, name in enumerate(name_list): self.loadFrames(frame_list[i], name, tool.ZOMBIE_RECT[name]['x']) - self.frames = self.walk_frames \ No newline at end of file + self.frames = self.walk_frames + +class NewspaperZombie(Zombie): + def __init__(self, x, y, head_group): + Zombie.__init__(self, x, y, c.NEWSPAPER_ZOMBIE, c.NEWSPAPER_HEALTH, head_group) + self.helmet = True + + def loadImages(self): + self.helmet_walk_frames = [] + self.helmet_attack_frames = [] + self.walk_frames = [] + self.attack_frames = [] + self.losthead_walk_frames = [] + self.losthead_attack_frames = [] + self.die_frames = [] + self.boomdie_frames = [] + + helmet_walk_name = self.name + helmet_attack_name = self.name + 'Attack' + walk_name = self.name + 'NoPaper' + attack_name = self.name + 'NoPaperAttack' + losthead_walk_name = self.name + 'LostHead' + losthead_attack_name = self.name + 'LostHeadAttack' + die_name = self.name + 'Die' + boomdie_name = c.BOOMDIE + + frame_list = [self.helmet_walk_frames, self.helmet_attack_frames, + self.walk_frames, self.attack_frames, self.losthead_walk_frames, + self.losthead_attack_frames, self.die_frames, self.boomdie_frames] + name_list = [helmet_walk_name, helmet_attack_name, + walk_name, attack_name, losthead_walk_name, + losthead_attack_name, die_name, boomdie_name] + + for i, name in enumerate(name_list): + self.loadFrames(frame_list[i], name, tool.ZOMBIE_RECT[name]['x'], c.WHITE) + + self.frames = self.helmet_walk_frames \ No newline at end of file diff --git a/source/constants.py b/source/constants.py index f5a2725..b43e5fe 100644 --- a/source/constants.py +++ b/source/constants.py @@ -59,6 +59,7 @@ MAP_OFFSET_Y = 100 MENUBAR_BACKGROUND = 'ChooserBackground' #PLANT INFO +PLANT_IMAGE_RECT = 'plant_image_rect' CAR = 'car' SUN = 'Sun' SUNFLOWER = 'SunFlower' @@ -70,6 +71,8 @@ THREEPEASHOOTER = 'Threepeater' REPEATERPEA = 'RepeaterPea' CHOMPER = 'Chomper' CHERRY_BOOM_IMAGE = 'Boom' +PUFFMUSHROOM = 'PuffMushroom' +SPIKEWEED = 'Spikeweed' PLANT_HEALTH = 5 WALLNUT_HEALTH = 30 @@ -92,10 +95,13 @@ CARD_CHERRYBOMB = 'card_cherrybomb' CARD_THREEPEASHOOTER = 'card_threepeashooter' CARD_REPEATERPEA = 'card_repeaterpea' CARD_CHOMPER = 'card_chomper' +CARD_PUFFMUSHROOM = 'card_puffmushroom' +CARD_SPIKEWEED = 'card_spikeweed' #BULLET INFO BULLET_PEA = 'PeaNormal' BULLET_PEA_ICE = 'PeaIce' +BULLET_MUSHROOM = 'BulletMushRoom' BULLET_DAMAGE_NORMAL = 1 #ZOMBIE INFO @@ -105,6 +111,7 @@ NORMAL_ZOMBIE = 'Zombie' CONEHEAD_ZOMBIE = 'ConeheadZombie' BUCKETHEAD_ZOMBIE = 'BucketheadZombie' FLAG_ZOMBIE = 'FlagZombie' +NEWSPAPER_ZOMBIE = 'NewspaperZombie' BOOMDIE = 'BoomDie' LOSTHEAD_HEALTH = 5 @@ -112,6 +119,7 @@ NORMAL_HEALTH = 10 FLAG_HEALTH = 15 CONEHEAD_HEALTH = 20 BUCKETHEAD_HEALTH = 30 +NEWSPAPER_HEALTH = 15 ATTACK_INTERVAL = 1000 ZOMBIE_WALK_INTERVAL = 70 diff --git a/source/data/entity/plant.json b/source/data/entity/plant.json index e69de29..94222aa 100644 --- a/source/data/entity/plant.json +++ b/source/data/entity/plant.json @@ -0,0 +1,9 @@ +{ + "plant_image_rect":{ + "PeaNormal":{"x":28, "y":0, "width":28, "height":34}, + "PeaIce":{"x":26, "y":0, "width":30, "height":34}, + "Chomper":{"x":0, "y":0, "width":100, "height":114}, + "PuffMushroom":{"x":0, "y":28, "width":35, "height":38}, + "BulletMushRoom":{"x":0, "y":1, "width":55, "height":21} + } +} \ No newline at end of file diff --git a/source/data/entity/zombie.json b/source/data/entity/zombie.json index 320d0b8..bbc81fb 100644 --- a/source/data/entity/zombie.json +++ b/source/data/entity/zombie.json @@ -13,6 +13,13 @@ "FlagZombie":{"x":56, "width":110}, "FlagZombieAttack":{"x":60, "width":100}, "FlagZombieLostHead":{"x":55, "width":110}, - "FlagZombieLostHeadAttack":{"x":55, "width":110} + "FlagZombieLostHeadAttack":{"x":55, "width":110}, + "NewspaperZombie":{"x":48, "width":92}, + "NewspaperZombieAttack":{"x":48, "width":92}, + "NewspaperZombieNoPaper":{"x":40, "width":98}, + "NewspaperZombieNoPaperAttack":{"x":48, "width":92}, + "NewspaperZombieLostHead":{"x":44, "width":96}, + "NewspaperZombieLostHeadAttack":{"x":48, "width":92}, + "NewspaperZombieDie":{"x":0, "width":100} } } \ No newline at end of file diff --git a/source/state/level.py b/source/state/level.py index eeb8650..65c216a 100644 --- a/source/state/level.py +++ b/source/state/level.py @@ -125,6 +125,8 @@ class Level(tool.State): for car in self.cars: car.update(self.game_info) + self.menubar.update(self.current_time) + self.checkBulletCollisions() self.checkZombieCollisions() self.checkPlants() @@ -142,6 +144,8 @@ class Level(tool.State): self.zombie_groups[map_y].add(zombie.BucketHeadZombie(c.ZOMBIE_START_X, y, self.head_group)) elif name == c.FLAG_ZOMBIE: self.zombie_groups[map_y].add(zombie.FlagZombie(c.ZOMBIE_START_X, y, self.head_group)) + elif name == c.NEWSPAPER_ZOMBIE: + self.zombie_groups[map_y].add(zombie.NewspaperZombie(c.ZOMBIE_START_X, y, self.head_group)) def canSeedPlant(self): x, y = pg.mouse.get_pos() @@ -172,8 +176,11 @@ class Level(tool.State): self.plant_groups[map_y].add(plant.RepeaterPea(x, y, self.bullet_groups[map_y])) elif self.plant_name == c.CHOMPER: self.plant_groups[map_y].add(plant.Chomper(x, y)) + elif self.plant_name == c.PUFFMUSHROOM: + self.plant_groups[map_y].add(plant.PuffMushroom(x, y, self.bullet_groups[map_y])) self.menubar.decreaseSunValue(self.plant_cost) + self.menubar.setCardFrozenTime(self.plant_name) self.map.setMapGridType(map_x, map_y, c.MAP_EXIST) self.removeMouseImage() #print('addPlant map[%d,%d], grid pos[%d, %d] pos[%d, %d]' % (map_x, map_y, x, y, pos[0], pos[1])) @@ -191,7 +198,7 @@ class Level(tool.State): image.set_alpha(128) self.hint_image = image self.hint_rect = image.get_rect() - self.hint_rect.x = pos[0] + self.hint_rect.centerx = pos[0] self.hint_rect.bottom = pos[1] self.hint_plant = True else: @@ -199,10 +206,15 @@ class Level(tool.State): def setupMouseImage(self, plant_name, plant_cost): frame_list = tool.GFX[plant_name] - rect = frame_list[0].get_rect() - width, height = rect.w, rect.h + if plant_name in tool.PLANT_RECT: + data = tool.PLANT_RECT[plant_name] + x, y, width, height = data['x'], data['y'], data['width'], data['height'] + else: + x, y = 0, 0 + rect = frame_list[0].get_rect() + width, height = rect.w, rect.h - self.mouse_image = tool.get_image(frame_list[0], 0, 0, width, height, c.BLACK, 1) + self.mouse_image = tool.get_image(frame_list[0], x, y, width, height, c.BLACK, 1) self.mouse_rect = self.mouse_image.get_rect() pg.mouse.set_visible(False) self.drag_plant = True @@ -287,7 +299,10 @@ class Level(tool.State): break else: if (plant.state == c.IDLE and zombie_len > 0): - plant.setAttack() + for zombie in self.zombie_groups[i]: + if plant.canAttack(zombie): + plant.setAttack() + break elif (plant.state == c.ATTACK and zombie_len == 0): plant.setIdle() diff --git a/source/tool.py b/source/tool.py index e9fd47d..4bf45be 100644 --- a/source/tool.py +++ b/source/tool.py @@ -160,9 +160,17 @@ def loadZombieImageRect(): f.close() return data[c.ZOMBIE_IMAGE_RECT] +def loadPlantImageRect(): + file_path = os.path.join('source', 'data', 'entity', 'plant.json') + f = open(file_path) + data = json.load(f) + f.close() + return data[c.PLANT_IMAGE_RECT] + pg.init() pg.display.set_caption(c.ORIGINAL_CAPTION) SCREEN = pg.display.set_mode(c.SCREEN_SIZE) GFX = load_all_gfx(os.path.join("resources","graphics")) -ZOMBIE_RECT = loadZombieImageRect() \ No newline at end of file +ZOMBIE_RECT = loadZombieImageRect() +PLANT_RECT = loadPlantImageRect() \ No newline at end of file