ambiera logo

Ambiera Forum

Discussions, Help and Support.

folder icon Ambiera Forum > CopperCube > Help with CopperCube
forum topic indicator Endless shooter
person icon
Sikes
Guest
Quote
2023-07-12 03:51:36

How can I make an endless wave of enemies spawn in my game at a reasonable rate

person icon
VP
Guest
Quote
2023-07-12 07:38:29

1- Create a "Spawner_node" (an empty node).

2- Add a "Game_character" behaviour to the "Spawner_node", (set it to "Random patrol" with 1000 speed, attacks: none).

3- Create an Enemy_node.

4- Add this behaviour to your Enemy node: Every few seconds: (or At Random intervals:)
Clone "Enemy_node", (action to do with clone): set Position of "Enemy_node", relative to "Spawner_node", position 0,0,0.

person icon
Sikes
Guest
Quote
2023-07-12 19:00:06

Tnks but I want it on such a way that they spawn near where the player is located so that they don't spawn elsewhere continously which will cause the game to crash

person icon
andgameplay
Registered User
Quote
2023-07-12 20:03:55

Hi Sikes, the VP gave to you the way. You can clone the enemies near the player: (action to do with clone): set Position of "Enemy_node", relative to "player", and you set the parameters of the position near of the player.

You can after a time, do the action "delete de clone" this way the game don't crash.

person icon
VP
Guest
Quote
2023-07-13 07:46:50

You can set a limit to the number of clones....

Before First Draw (and on reload): Set Variable "Enemies" =0

Every few seconds (10,000ms): If Variable "Enemies" <100, Clone "Enemy_node"

Action to do with clone: Set Variable: "Enemies" +1

Action to do when enemy killed: Set Variable: "Enemies" -1

In this example, it will clone an enemy (every 10 seconds) but only if is there are less than 100 enemies in the scene. When you kill an enemy, it reduces the count by one. When you restart the game, it resets the enemy counter.

person icon
Sikes
Guest
Quote
2023-07-13 08:49:05

Thanks again Pete, what about a highscore how do I do that


Create reply:










 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


icon_holyicon_cryicon_devilicon_lookicon_grinicon_kissicon_monkeyicon_hmpf
icon_sadicon_happyicon_smileicon_uhicon_blink   






Copyright© Ambiera e.U. all rights reserved.
Contact | Imprint | Products | Privacy Policy | Terms and Conditions |