I have this silly problem. I'm making this horizontal scrolling game and when the timer is over I want to spawn a 'portal' on the next screen from my sprite. So like Sprite.X+1000 for example. The problem is since my sprite is constantly moving the X keeps changing and the portal always stays at +1000. Any idea how to fix this?
Thanx <img src="smileys/smiley1.gif" border="0" align="middle" />
seems to me that you just need to spawn it on background layer , not on the same layer as player is.
irina i tried that as well. but since sprite.x keeps changing it keeps moving with it. or maybe i'm doing it wrong
If you spawn the portal at +1000, the portal then should keep its X, not changing it with the players X.
It depends on how you did your wrap, but mostly I don't understand why you change the X of the portal to player.X+1000... Spawning it at this X won't "link" it to the player, the player.X variation won't interfere with the portal.X.
Could you post your capx for better help maybe ?
Guizmus I can't really post the capx because there is a ton of stuff in there. The best I can do is give you a screenshot of this bit
Basically I spawn the portal on the sprite.X+700 (bluetruck) and then move the sprite toward the portal. If i use set position it will keep moving the portal. If i use create (like in this case) it will keep spawning portals after portals.
how about to add system repeat (1) for creation?
Well, you can always post a sample capx, duplicate of the original with everything removed but what you need help on.
If you just add a condition "once while true" on your event 43, your problem will be solved though. The problem right now is that you don't have a trigger for the portal to appear, you just check if the time has passed. But as once the time has pasted, it has passed every tick, your condition is always true, thus the once while true.
Develop games in your browser. Powerful, performant & highly capable.
It works! The 'one while true' fixed everything! Thank you irina and Guizmus for the support :)