Spawnpoints: location and disappear #628
Replies: 12 comments
-
This post has been migrated automatically from the old LITIENGINE forum (2018 - 2022). |
Beta Was this translation helpful? Give feedback.
-
This post has been migrated automatically from the old LITIENGINE forum (2018 - 2022). |
Beta Was this translation helpful? Give feedback.
-
This post has been migrated automatically from the old LITIENGINE forum (2018 - 2022). |
Beta Was this translation helpful? Give feedback.
-
This post has been migrated automatically from the old LITIENGINE forum (2018 - 2022). |
Beta Was this translation helpful? Give feedback.
-
This post has been migrated automatically from the old LITIENGINE forum (2018 - 2022). |
Beta Was this translation helpful? Give feedback.
-
This post has been migrated automatically from the old LITIENGINE forum (2018 - 2022). |
Beta Was this translation helpful? Give feedback.
-
This post has been migrated automatically from the old LITIENGINE forum (2018 - 2022). |
Beta Was this translation helpful? Give feedback.
-
This post has been migrated automatically from the old LITIENGINE forum (2018 - 2022). |
Beta Was this translation helpful? Give feedback.
-
This post has been migrated automatically from the old LITIENGINE forum (2018 - 2022). |
Beta Was this translation helpful? Give feedback.
-
This post has been migrated automatically from the old LITIENGINE forum (2018 - 2022). |
Beta Was this translation helpful? Give feedback.
-
This post has been migrated automatically from the old LITIENGINE forum (2018 - 2022). |
Beta Was this translation helpful? Give feedback.
-
This post has been migrated automatically from the old LITIENGINE forum (2018 - 2022). |
Beta Was this translation helpful? Give feedback.
-
This post has been migrated automatically from the old LITIENGINE forum (2018 - 2022).
Posted: 2018-11-21 18:15:50
User: CalvinMT [] (age: 1451 days 🔥; posts: 114)
I'm trying out the spawn features, but encountered two problems.
I've got this second line in the Game class under "@OverRide public void prepare()":
private EntitySpawner <Ennemy> ennemySpawner; ennemySpawner = new EnnemySpawner(getEnnemySpawnPoints(), 1000, 5);
1000 is the time to wait before the next spawn (in milliseconds).
5 is the number of entities to spawn.
In other words: spawn 5 entities each second (I think...).
Problems:
1.When the entities are spawning, they disappear one after the other in a flash, except for the last one which stays at its place until the next spawn (I checked the environment and they are still in memory).2.I've got four large spawnpoints, but the entities only spawn in the corners that positions the spawnpoints they're in.I just got an idea for the second one.
When a new entity is created, its location is on: ".getSpawnPoints().get(0).getLocation()".
How can I randomize the location while staying in the spawnpoint?
Would anyone happen to have an idea why these are happening?
Beta Was this translation helpful? Give feedback.
All reactions