maxman
Well-known member
In the past, I had created a platformer level which you could spawn enemies without requiring groups, but with a calculation of scrollpos (at) and x coords of enemies to spawn outside of the screen, for them to appear exactly like a platformer without lagging speed. Thanks to @Bloodbane, I got better with the platforming method using math. However, I feel like this is different because of the level's height size I'm using for jumping/moving up until you reach its peak. Also, I keep using
I put non-enemies first in the line before I put enemies.
I can use "position" property to set their locations and give follow animations as non-moving motions. But how can I avoid this lag when I have many entities spawned with at 0 (or any value higher than 0) and without grouping on certain altitude positions in one go to look very seamless like the Mega Drive (Genesis) version of X-Men?
at 0 when I spawn many entities without grouping because I worry if I scroll left and right while using direction both and moving up, the performance lags the gameplay experience especially those specific entities that perform actions with given sounds, such as repetitive shooting, looping traps with sounds, etc. I have to use a non-moving animation as a follow animation and place them in a specific position with "position" property to change. For example, you start with a non-moving enemy until you get close to him and a(n) none/enemy/trap-type entity that is far away from and way above the two, but it's actively playing its sound (because it's not grouped in the level).
Code:
spawn Respawn
@script
void main()
{
void P1 = getplayerproperty(0, "entity");
changeopenborvariant("xpos", 580);
changeopenborvariant("ypos", 2000);
changeentityproperty(P1,"position", 740, NULL(), 1);
changeentityproperty(P1,"direction", 0);
}
@end_script
coords 740 2137 1 #740-160=580
flip 1
at 0
spawn trap1
coords 400 2137 500
at 0
spawn trap2
@script
void main(){
void self = getlocalvar("self");
performattack(self, openborconstant("ANI_FOLLOW3"));
changeentityproperty(self, "position", 360, 2137, 800);
}
@end_script
coords 200 2137 800
at 0
spawn enemy1
coords 330 2137 #330-160=170
at 0
I put non-enemies first in the line before I put enemies.
I can use "position" property to set their locations and give follow animations as non-moving motions. But how can I avoid this lag when I have many entities spawned with at 0 (or any value higher than 0) and without grouping on certain altitude positions in one go to look very seamless like the Mega Drive (Genesis) version of X-Men?
Last edited: