11#include " BulletHelper.h"
22#include " CircleTypeBullet.h"
33#include " ../../XCInterpreter/ScriptLoader.h"
4- Bullet * BulletHelper::getNewBulletObject (std::string bulletImage,std::string bulletType, glm::vec4 divideInfo, glm::vec3 scaleInfo, glm::vec3 initCoord
5- , float velocity, float acceleration, float angle, float increateAngle, int reboundTime, bool aimPlayer)
4+ Bullet * BulletHelper::getNewBulletObject (std::string bulletImage,std::string bulletType, glm::vec4 divideInfo, glm::vec3 scaleInfo, glm::vec3 collideSize,
5+ glm::vec3 initCoord, float velocity, float acceleration, float angle, float increateAngle, int reboundTime, bool aimPlayer,
6+ int particleDensity, float particleFinishTime, float particleVelocity, float particleSize, glm::vec4 particleColor)
67{
78 Bullet *bullet = nullptr ;
89 if (bulletType == " circleTypeBullet" ) {
9- bullet = new CircleTypeBullet (bulletImage, divideInfo, scaleInfo, initCoord, velocity, acceleration, angle, increateAngle, reboundTime, aimPlayer);
10+ bullet = new CircleTypeBullet (bulletImage, divideInfo, scaleInfo, collideSize, initCoord, velocity, acceleration, angle, increateAngle, reboundTime, aimPlayer,
11+ particleDensity, particleFinishTime, particleVelocity, particleSize, particleColor);
1012 }
1113 return bullet;
1214}
@@ -19,9 +21,11 @@ Bullet * BulletHelper::parseBulletObject(PyObject * bulletObject)
1921 auto imageInfo = PyObject_CallMethod (bulletObject, " _cpp_getInitRenderInfo" , NULL );
2022 auto bulletGenerateInfo = PyObject_CallMethod (bulletObject, " _cpp_getGenerateInfo" , NULL );
2123 auto bulletCoordInfo = PyObject_CallMethod (bulletObject, " _cpp_getInitCoord" , NULL );
24+ auto bulletReleaseInfo = PyObject_CallMethod (bulletObject, " _cpp_getReleaseParticleInfo" , NULL );
2225
23- const char * bulletImage, *bulletType; int divideInfo[4 ]; float scaleInfo[3 ];
24- PyArg_ParseTuple (imageInfo, " ss(iiii)(fff)" , &bulletImage, &bulletType, ÷Info[0 ], ÷Info[1 ], ÷Info[2 ], ÷Info[3 ], &scaleInfo[0 ], &scaleInfo[1 ], &scaleInfo[2 ]);
26+ const char * bulletImage, *bulletType; int divideInfo[4 ]; float scaleInfo[3 ], collideSize[3 ];
27+ PyArg_ParseTuple (imageInfo, " ss(iiii)(fff)(fff)" , &bulletImage, &bulletType, ÷Info[0 ], ÷Info[1 ], ÷Info[2 ], ÷Info[3 ],
28+ &scaleInfo[0 ], &scaleInfo[1 ], &scaleInfo[2 ], &collideSize[0 ], &collideSize[1 ], &collideSize[2 ]);
2529
2630
2731 float velocity, acceleration, angle, increaseAngle; int aimPlayer, reboundTime;
@@ -30,9 +34,14 @@ Bullet * BulletHelper::parseBulletObject(PyObject * bulletObject)
3034 float initCoord[3 ];
3135 PyArg_ParseTuple (bulletCoordInfo, " fff" , &initCoord[0 ], &initCoord[1 ], &initCoord[2 ]);
3236
33- bullet = BulletHelper::getNewBulletObject (bulletImage, bulletType, glm::vec4 (divideInfo[0 ], divideInfo[1 ], divideInfo[2 ], divideInfo[3 ])
34- , glm::vec3 (scaleInfo[0 ], scaleInfo[1 ], scaleInfo[2 ]), glm::vec3 (initCoord[0 ], initCoord[1 ], initCoord[2 ])
35- , velocity, acceleration, angle, increaseAngle, reboundTime, aimPlayer);
37+ int particleDensity; float lifeTime, particleVelocity, particleSize; float particleColor[4 ];
38+ PyArg_ParseTuple (bulletReleaseInfo, " ifff(ffff)" , &particleDensity, &lifeTime, &particleVelocity, &particleSize,
39+ &particleColor[0 ], &particleColor[1 ], &particleColor[2 ], &particleColor[3 ]);
40+
41+ bullet = BulletHelper::getNewBulletObject (bulletImage, bulletType, glm::vec4 (divideInfo[0 ], divideInfo[1 ], divideInfo[2 ], divideInfo[3 ]),
42+ glm::vec3 (scaleInfo[0 ], scaleInfo[1 ], scaleInfo[2 ]),glm::vec3 (collideSize[0 ], collideSize[1 ], collideSize[2 ]),
43+ glm::vec3 (initCoord[0 ], initCoord[1 ], initCoord[2 ]), velocity, acceleration, angle, increaseAngle, reboundTime, aimPlayer,
44+ particleDensity, lifeTime, particleVelocity,particleSize, glm::vec4 (particleColor[0 ], particleColor[1 ], particleColor[2 ], particleColor[3 ]));
3645 if (bullet != nullptr ) {
3746 bullet->BulletInit ();
3847 }
0 commit comments