it is my second game with impactjs and I have a problem
the entities falling from the top (using "ig.game.spawnEntity" slow down during time . how can I let them fall with a fixed velocity ?
1 month ago
If you set an entity velocity
entity.vel.y = 100;
it should remain constant until you change it again.
Unless, maybe you have set the friction
No I didn't use friction property and using velocity did not work
this.pos.y = this.pos.y + 5;
is there any thing wrong with this code?
4 weeks ago
Maybe its a performance issue. How many instance are you spawning ?
What is the entity doing maybe its doing a lot in the update function.
4 weeks ago
Quote from ansimuz
Maybe its a performance issue.
@ola_soubra, if you require the "impact.debug.debug" module, you should be able to see what FPS (frames per second) the game is running at. If the game is running at a low FPS, it may look like everything is slowing down.
Every 0.75 second an entity is spawn ( 7 entities ) in a screen with height 600
this.flow1 = new ig.Timer(0.75)
this.flow = [EntityBluesnow , EntityGreensnow , EntityBlacksnow ]
this.smile = this.flow.random();
var x = [10,176,340].random() ;
I don't know how to see FPS I will try to find it
this.pos.y += this.vel.y * ig.system.tick + 3;
this code for the spawning entity
I can see the fps
27 entities 60 fps
I think it is not a performance issue
Oh the number of entities increase with time you're right
I killed all entities after leaving screen AND THE PROBLEM IS SOLVED
THANK YOU JONCOM AND ANSIMUZ
3 weeks ago
Glad you got it working :)
Page 1 of 1