Problems with instance variables

Get help using Construct 2

Post » Tue Jul 24, 2012 4:43 am

Hey guys, so building my first game, and ran into an issue that I can't seem to resolve. First, here is a link to the game so you'd know what I'm talking about:

http://dl.dropbox.com/u/78940841/WingsOfDawn/index.html.

The issue has to do with enemy lives. With the small enemy plane, I have no issues because 1 hit kills that enemy, and it's not in an instance variable. But I wanted the submarine to have 4 lives, so I made it have instance variable of 3. The problem with that, is that if there's more than 1 sub on the screen and one gets destroyed, the other gets destroyed too.

My question is, should I add something else to make each sub unique so that they wouldn't all get destroyed when I'm shooting at one? Or do I need to do something different, meaning not use instance variables?

-Eye
B
4
Posts: 3
Reputation: 756

Post » Tue Jul 24, 2012 7:04 am

You probably aren't picking correctly. Here's a quick test showing instance variables working, and destroying one sprite at a time.

TestInstanceVariables
ImageImageImage
B
67
S
19
G
124
Posts: 3,219
Reputation: 74,425

Post » Tue Jul 24, 2012 7:30 am

Okay thanks, I'll keep looking for mistakes I may have made..hmm I can't seem to open the file, was it made in Construct 1? Says it's build 99...
B
4
Posts: 3
Reputation: 756

Post » Tue Jul 24, 2012 2:37 pm

It's Construct 2, release 99. I did double check it downloads and runs.
ImageImageImage
B
67
S
19
G
124
Posts: 3,219
Reputation: 74,425

Post » Tue Jul 24, 2012 3:25 pm

r99 is the latest beta release, I'm guessing you have r95, the latest stable release. You can download it from the link "Download Construct 2" at the bottom of the front page under "Make games", or just click the one in my signature.
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Tue Jul 24, 2012 3:55 pm

@blackhornet + Nimtrix

Sorry, my fault, I did have r95..installed the 99 release now, and file works. Will study it when I get home from work. Thanks for the help .
B
4
Posts: 3
Reputation: 756


Return to How do I....?

Who is online

Users browsing this forum: kamens503, Yahoo [Bot] and 25 guests