User prompt
Don't set direction and rotation when in the ExplosionFragment class. Delete those two lines.
User prompt
In the Create Explosion method, after setting direction, also set rotation.
User prompt
The rotation of the explosion fragment seems random. The rotation should be the direction it's moving in.
User prompt
When the fragments spawn, I want them to sort of point in the direction of movement. Currently, the rotation seems wrong. Can you try to fix this?
User prompt
when spawning fragments at 45 degrees to the rotation they're spawning at.
User prompt
create eight fragments rather than six fragments when something explodes or you press the screen.
User prompt
Rather than spawning six fragments, spawn eight fragments.
User prompt
You seem to be factoring in enemies' existing width and height and fragments' width and height when calculating their new size. Don't factor in those.
User prompt
When scaling enemy or fragment, just use a fixed number. Don't factor in the enemies existing with a height or the fragments existing with a height.
User prompt
When scaling targets and fragments, don't set width and height directly. Use scale.set instead.
User prompt
Rotate each fragment asset such that they are rotated according to the direction they're flying in.
User prompt
When targets shrink, also shrink the fragments. So as you progress through levels, the fragments should also get smaller and smaller.
User prompt
Make the initial target size twice as big.
User prompt
When a level starts, write what level you're at at the center of the screen, and then fade it out after a few seconds.
User prompt
When you complete a label, flash the screen white.
User prompt
Please fix the bug: 'TypeError: undefined is not an object (evaluating 'explosions[i].radius')' in or related to this line: 'if (explosions[i].radius > 200) {' Line Number: 112
User prompt
There is too many explosion fragments being generated, please only generate six.
User prompt
The explosion acid itself is unnecessary, just halve the fragments and remove the explosion otherwise.
User prompt
Please fix the bug: 'TypeError: undefined is not an object (evaluating 'explosions[i].radius')' in or related to this line: 'if (explosions[i].radius > 200) {' Line Number: 135
User prompt
Please remove all fragments when you start the next level.
User prompt
Make sure fragments who fly off the screen are removed and garbage collected.
User prompt
Add levels to the game such that, when you have destroyed all targets, a new level starts that has one more target to hit, but the target is 10% smaller.
User prompt
So, the targets that you have to hit should spawn at a random position on the screen and they should have a movement vector. If they move off the screen, they should just wrap around the other side of the screen.
User prompt
use a different asset for fragments.
User prompt
When an explosion fragment intersects a target, the fragment should be destroyed.
===================================================================
--- original.js
+++ change.js
@@ -25,26 +25,8 @@
}
};
});
//<Assets used in the game will automatically appear here>
-// Explosion class
-var Explosion = Container.expand(function () {
- var self = Container.call(this);
- var explosionGraphics = self.attachAsset('explosion', {
- anchorX: 0.5,
- anchorY: 0.5
- });
- self.radius = 50;
- self.expandRate = 5;
- self.update = function () {
- self.radius += self.expandRate;
- explosionGraphics.width = self.radius * 2;
- explosionGraphics.height = self.radius * 2;
- if (self.radius > 200) {
- self.destroy();
- }
- };
-});
// Explosion Fragment class
var ExplosionFragment = Container.expand(function () {
var self = Container.call(this);
var fragmentGraphics = self.attachAsset('fragment', {
@@ -85,20 +67,15 @@
var level = 1;
var enemySize = 100;
// Function to create an explosion
function createExplosion(x, y) {
- var explosion = new Explosion();
- explosion.x = x;
- explosion.y = y;
- explosions.push(explosion);
- game.addChild(explosion);
- // Create six explosion fragments
- for (var i = 0; i < 6; i++) {
+ // Create twelve explosion fragments
+ for (var i = 0; i < 12; i++) {
var fragment = new ExplosionFragment();
fragment.x = x;
fragment.y = y;
// Set the direction of each fragment to form a perfect circle
- fragment.direction = i * (Math.PI / 3);
+ fragment.direction = i * (Math.PI / 6);
explosions.push(fragment);
game.addChild(fragment);
}
}
Hexagonal target sprite sheet. Bright colors, cartoon. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Puzzle game background image. Lots of octagons and other interesting elements. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.