Problems with Instances

Just started using Construct 2? Post your questions here

Post » Sun Aug 21, 2016 3:01 am

Message: AwesomePuppy can only post plain text URLS until they have 500 rep. 2 URLS modified. Why?
So, I'm trying to make a ship based game, and I have hit a roadblock. Every time I destroy an enemy ship, the ship and its turrets blow up. But the thing is, when a single ship gets destroyed, all turrets on the map get destroyed. Also, how do i add in a reload system for the player's ship's guns. Any suggestions?

You can play here: http://localhost:50000/
Download: https://www.dropbox.com/home?preview=Ship+Battles.capx
B
3
Posts: 6
Reputation: 187

Post » Sun Aug 21, 2016 3:58 am

You need conditions to pick the turrets that blow up. In your conditions, you probably already reference the ship, so the game knows which ship to destroy. If you add an action to destroy turret without picking any, it is assumed that that action will be applied to all turrets.

Try adding the condition turret is overlapping ship.

Utilizing containers is a good way to work around this as well.

There are many many ways to implement reloading, so without any further detail on the specific behavior you want I'm going to just suggest you run a quick search. Generally it involves a counter variable to keep track of ammo remaining and some events to handle what happens in different "states" (ammo full, partially empty, empty).
Mistakes were made.
B
53
S
27
G
114
Posts: 1,699
Reputation: 64,446

Post » Sun Aug 21, 2016 2:24 pm

AwesomePuppy if you want to learn about INSTANCE VARIABLE take look at this tutorial link below


https://www.scirra.com/tutorials/806/instance-variable
B
256
S
39
G
15
Posts: 1,983
Reputation: 41,036


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 2 guests