Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Problems spawning monsters in Cloud Jump
-
I wanted to add monsters to Cloud Jump, but am having some problems. Monsters should spawn on random clouds, not randomly falling as they are now. Also, colliding with the monsters currently does not do anything. Any help would be appreciated. Here is the Github Repo.
-
No need to paste entire code when you link to it!
Anyway, you want enemies to stay fixed to random clouds?
Or fall down with gravity? -
Fixed to random clouds please!
-
Looks like you forgot to lower enemies along with lowering scenery.
If you want to spawn on a cloud, in 'Enemy.init
startcloud=scene.scenery[randint(0,len(scene.scenery)-1)] self.hit = False self.x = startcloud.bounds.x self.initial_x = self.x self.y = startcloud.bounds.y
Then in lower scenery, you probably want
for enemy in self.enemies: enemy.y -= y
You might consider spawning enemies in the cloud generation stage, so that they always spawn offscreen, rather than sometimes appearing below you. In that case, you'd roll the die when a cloud is created, and if an enemy gets generated, you'd create it and set the starting cloud as an input to Enemy....
-
This just makes them spawn FROM clouds. Then they fall down. Also, I updated the script. Monsters now kill randomly, and when they do, its only when you hit them from the top. Still not as supposed to.
-
I created a pull req to your github which should do what you want. Basically set speed and amp of enemies to 0. Lower them in lower scenery. And spawn them within generate clouds, based on a density factor. You may need to adjust y to get them on clouds, rather than suspended from them
-
Whenever I adjust the y (say add 100 to get them on top) only on some clouds the monsters go on top and on others they go way further, is there something I can use to fix that?