Note
This is a cpp program using visual studio
Introduction
This is my very first cpp project.
To say honestly, it’s just a homework for my college course Fundamentals of Programming and Algorithms Ⅰ in the first year in UESTC.
By the way, we are required to finish this hw in corporation. However, as a freshmen both in college and in the field of software engineering, I haven’t learned that team collabration is very important.
As a result, I finish this by myself while watching the videos by rock.
Self-thinking
For first project, I think it is okay.
It can be seen as the start of my cs journey
Content
knowledge
- basic knowledge of cpp
- process control
- function calls
Update Log
-
change all the sunshine animation control from integer to float for smoother animation
-
change sunshine ball animation implementation model from offsite to bezier curve abandon unnecessary sunshineball struct menbers (x,y,xoff,yoff,destY)
-
change sound playing method several times,finally use the method alias
-
fix there is a ghost image in last mouse clicking position when dragging plants from banner (need to update msg.x and msg.y when left button down in the function “userClick()”)
-
fix only one Peashooter shoot if increase createZombies frequency (add shootTimer for every plants instead of using one “count” for all)
-
change when to minus sunshine
-
add most audio by PlaySoundAsync
-
add zombies eating sound by PlaySound, also by adding soundFlag and soundCount to zombie struct to control
-
add eatingfre to zombie struct to slow zombies eating animation
-
fix when you win the game,but the zombies are still created (this is actually a variable conflict,the global zmCount meet the static zmCount) now change the global zmCount to zmCnt
-
adjust zombies create frequency if (zmCnt <= ZM_MAX * 0.15) {zmFre = 600;} else if (zmCnt <= ZM_MAX * 0.75) {zmFre = rand() % 200 + 100;} else {zmFre = 10;}
If this article helped you, please share it with others!
Some information may be outdated




