A few questions based on the code you can download and run here. (I figure it would help to run and see the full code, it’s mostly clean and documented. Some info: run the WorldClass.py file to play. WASD moves, space shoots, numbers 1 2 and 3 switch weapons, ESC quits.)
- I’m having issues getting the collision on my enemies to work. Right now it uses a collision queue on each enemy. Each enemy runs a task (EnemyShipClass.py, line 13) that removes the bullet node, sets the enemy kill flag to True which ensures the ship will be removed by the UpdateEnemies method (WorldClass.py, line 111).
I’d like for this to be happening via an event, but anything I’ve tried fails to register any hits. The collision information for the enemy ship is at EnemyShipClass.py line 76.
-
Along the same lines as above, when it DOES register a hit, is there a cleaner way to remove the enemy and the bullet? Right now it’s a mix of removing nodes and deleting the class instance that was the ship, but that doesn’t get rid of the task associated with checking collisions for the enemy, another reason I was hoping to just use events.
-
I’ve been using globalClock.getDt() to make all movements for my ships and bullets, thinking that was supposed to moderate their speed over time rather than based on frames, but depending on what computer I use I’m seeing incredibly different results. Am I doing something wrong? (Movement of player ship in PlayerShipClass.py, line 80).
Any help on this would be greatly appreciated! I’m new so these concepts don’t quite come naturally to me.