pvzclass写的低创作品
pvzclass.cpp:
#include "pvzclass.h"
#include <iostream>
#include "events.h"
#include <ctime>
using namespace std;
int getTime() {
return clock();
}
int main()
{
DWORD pid = ProcessOpener::Open();
if (pid)
{
PVZ* pPVZ = new PVZ(pid);
Creater::AsmInit();
EnableBackgroundRunning();
if (pPVZ->BaseAddress)
{
int lastTime = 0;
int t = 1;
pPVZ->Sun = 5000;
Creater::CreatePlant(PlantType::Starfruit,2,4);
while (1) {
int now = getTime();
if (now - lastTime > 200) {
for (int i = 0; i < 5; i++)
{
Creater::CreateProjectile(ProjectileType::Star, 375, 300, i * 72 + 0.5*2*t*t, 2);
}
lastTime = now;
t += 1;
}
}
}
delete pPVZ;
}
return 0;
}