Code edit (1 edits merged)
Please save this source code
User prompt
I still do not visibly see mishnus radius, we need a spherical visual element that represents it. Also The humans are not moving around, make sure they are aiming aimlessly around the view port, bouncing of the edges of the viewport going the opposite direction, and that if they enter mishnus radius they speed up and try to run away
User prompt
So far we only have 1 type/class of humans= human_1 There should be many humans around on the map, moving around. Mishnus "harvest radius" must be visible to the player
User prompt
Please fix the bug: 'TypeError: Human.prototype.update is undefined' in or related to this line: 'Human.prototype.update.call(self);' Line Number: 38
Code edit (1 edits merged)
Please save this source code
User prompt
Not sure why but the game is completely frozen as the game starts. I cannot move mishnu. I also dont see her radius. And there seem to be only 1 instance of human 1, we need many
User prompt
Please fix the bug: 'TypeError: Human.prototype.update is undefined' in or related to this line: 'Human.prototype.update.call(self);' Line Number: 36
Code edit (1 edits merged)
Please save this source code
User prompt
please fix this situation i our code
User prompt
Please fix the bug: 'self is undefined' in or related to this line: 'self.update = function () {' Line Number: 29
User prompt
Please fix the bug: 'self is undefined' in or related to this line: 'self.update = function () {' Line Number: 29
User prompt
Please fix the bug: 'self is undefined' in or related to this line: 'self.update = function () {' Line Number: 29
User prompt
Please fix the bug: 'self is undefined' in or related to this line: 'self.update = function () {' Line Number: 29
User prompt
Please fix the bug: 'self is undefined' in or related to this line: 'self.update = function () {' Line Number: 29
User prompt
Please fix the bug: 'self is undefined' in or related to this line: 'self.update = function () {' Line Number: 29
User prompt
Mishnu is controlled by the cursor. The cursor indicates where Mishnu is going, but she is going at a constant rat of speed. She is at the center of a circle. The circle is not very big but about 3 times here size. We have the humans. They are scattered throughout the view port. They are in constant motion moving across the screen. WHen they reach the edge of the viewport they bounce off and go the opposite direction. They move all over. This is for our class of humans, "human 1". When a "human 1" is in mishnu's radius, it take 2 seconds for mishnu to harvest them. The moment any humans is in mishnu's radius they try attempt to run away. However if mishnu is able to keep them in the radius for 2 seconds they get harvested, and they disappear. To keep track of the humans mishnu has harvested we have in bold white letters at the bottom right Cargo: # of (humans harvested) / 10 (Max Cargo for Mishnu at level 1). There is a thin bar that is off limits at the bottom of the viewport, where cargo information lies, in this area, nor humans, nor mishnu can navigate it. Its reserved for text
Initial prompt
Mishnu
===================================================================
--- original.js
+++ change.js
@@ -7,9 +7,8 @@
var radiusGraphics = self.attachAsset('radius', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 3,
- // Scale the radius to make it visible
scaleY: 3 // Scale the radius to make it visible
});
self.update = function () {
self.x = mishnu.x;
@@ -26,8 +25,9 @@
anchorY: 0.5
});
self.speedX = (Math.random() * 2 - 1) * 5; // Random speed in X direction
self.speedY = (Math.random() * 2 - 1) * 5; // Random speed in Y direction
+ self.inRadiusStartTime = null; // Track time in radius
self.update = function () {
self.x += self.speedX;
self.y += self.speedY;
// Bounce off edges of the viewport
@@ -45,33 +45,19 @@
// Mishnu's radius
var runSpeed = 10; // Speed to run away
self.x += dx / distance * runSpeed;
self.y += dy / distance * runSpeed;
- }
- };
- return self;
-});
-// Create a new class for Human1 which is a subclass of Human
-var Human1 = Human.expand(function () {
- var self = Human.call(this);
- Human.call(self);
- self.update = function () {
- Human.call(self);
- // Check if this human is in Mishnu's radius
- var dx = self.x - mishnu.x;
- var dy = self.y - mishnu.y;
- var distance = Math.sqrt(dx * dx + dy * dy);
- if (distance < 150) {
- // Mishnu's radius
- var runSpeed = 2; // Speed to run away
- self.x += dx / distance * runSpeed;
- self.y += dy / distance * runSpeed;
- if (distance < 100 && Date.now() - mishnu.lastHarvestTime >= 2000) {
+ if (self.inRadiusStartTime === null) {
+ self.inRadiusStartTime = Date.now();
+ } else if (Date.now() - self.inRadiusStartTime >= 2000) {
// Harvest the human
self.y = -100; // Reset human position
+ self.x = Math.random() * 2048;
+ self.inRadiusStartTime = null; // Reset timer
mishnu.humansHarvested++;
- mishnu.lastHarvestTime = Date.now();
}
+ } else {
+ self.inRadiusStartTime = null; // Reset timer if out of radius
}
};
return self;
});
@@ -124,10 +110,11 @@
radius.y = mishnu.y;
// Array to hold humans
var humans = [];
// Create humans at random positions
-for (var i = 0; i < 5; i++) {
- var human = new Human1();
+for (var i = 0; i < 50; i++) {
+ // Increased number of humans to spawn more
+ var human = new Human();
human.x = Math.random() * 2048;
human.y = Math.random() * 2732 - 100; // Avoid bottom reserved area
humans.push(human);
game.addChild(human);
blurry texture background 4k black and white
can of Dog Food. Game asset. 3d clipart. Blank background. High contrast. No shadows..
black capsule. Game asset. 3d clipart. Blank background. High contrast. No shadows..
woman in short shorts. mobile game art. pixel art. full body. front facing. Blank background. High contrast. No shadows.
laser beam cartoon game asset. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
bone. clipart. cartoon. Blank background. High contrast. No shadows..
Game Over. Red game letters, dripping. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Dog_panting
Sound effect
Agony_Yell_1
Sound effect
Music_Level_1_5
Music
Music_Level_1_4
Music
Agony_Yell_2
Sound effect
Agony_Yell_3
Sound effect
Agony_Yell_4
Sound effect
Agony_Yell_5
Sound effect
Agony_Yell_6
Sound effect
Agony_Yell_7
Sound effect
Dog_Crunch
Sound effect
Dog_Crunch_2
Sound effect
Dog_Crunch_3
Sound effect
Ding_1
Sound effect
Squish_1
Sound effect
Squish_2
Sound effect
Squish_4
Sound effect
Squish_3
Sound effect
Factory_Deposit
Sound effect
Factory_Operation
Sound effect
Level_Up
Sound effect
Bark
Sound effect
Hit
Sound effect
Agony_Yell_8
Sound effect
Agony_Yell_9
Sound effect
GiggleMan_1
Sound effect
GiggleMan_2
Sound effect
GiggleMan_3
Sound effect
GiggleMan_4
Sound effect
Booster_Sound
Sound effect
Can
Sound effect
woosh
Sound effect
Agony_Yell_10
Sound effect
Bark_2
Sound effect
Bark_3
Sound effect
laser
Sound effect
searing
Sound effect
laser_2
Sound effect
Laser_3
Sound effect
Laser_4
Sound effect
Boss_Hit
Sound effect
Boss_Hit_2
Sound effect
Boss_Hit_3
Sound effect
GiggleMan_5
Sound effect
GiggleMan_6
Sound effect
hip_hop_loop
Sound effect