-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed a bug in ObjectManager that was causing the engine to freeze if…
… an object was removed, then added again. Also got it so Entity::update now calls Entity.onUpdate in the javascript vm. Lastly, tried to get some properties binded, but the compiler is giving me some problems.
- Loading branch information
Showing
7 changed files
with
72 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,22 @@ | ||
for(var i=0; i<360; i+=45){ | ||
print("Making entity at angle "+i); | ||
var f = new Entity(300, 200, 100, 100, i, "bullet.png"); | ||
if(i==0) setTimeout(function(){ f.destroy(); }, 4000); | ||
f.onUpdate = function(){ | ||
var tss = 2000; //f.timeSinceSpawn(); | ||
var time = tss*2; | ||
while(time > 6000){ | ||
time -= 6000; | ||
} | ||
//f.angle = (tss/5)+f.initialAngle; | ||
//f.posX = f.initialPosX + (time*Math.sin((f.initialAngle+(time/10))*(3.14/180))/17); | ||
//f.posY = f.initialPosY + (time*Math.cos((f.initialAngle+(time/10))*(3.14/180))/17); | ||
//f.posX++; | ||
//f.posY++; | ||
f.posX = 300; | ||
f.posY = 200; | ||
}; | ||
if(i==0){ | ||
setTimeout(function(){ f.hide(); }, 2000); | ||
setTimeout(function(){ f.show(); }, 4000); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,6 @@ class Entity : public GameObject{ | |
|
||
void show(); | ||
void hide(); | ||
|
||
private: | ||
int objectmanagerId; | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters