How do I Pick Up one Item and Drop Another on Key Press

Get help using Construct 2

Post » Tue Apr 14, 2015 1:25 am

@chrisinfinger - Yeah, I think it's going to have to wait until I can afford the full version, but I have a pretty good idea of how I'm going to go about it. Cheers for everything mate, it's been a big help.

@LittleStain - Thank you for your input, but I'm trying to wrap my head around what you are saying (functions are a bit of a new thing to me). Without using families, wouldn't you still need to make a different Event for each Object? etc:

Player - Overlap - Gun1 --> drop current weapon/pickup Gun1
Player - Overlap - Gun2 --> drop current weapon/pickup Gun2
Player - Overlap - Gun3 --> drop current weapon/pickup Gun3

... I have a feeling I just made no sense. The boss gave me 2 weeks to do 2 months worth of work, so I'm pulling late hours and I'm not really with it at the moment.

My deadline approaches so I won't have a chance to work on this game for a while. It might give me a chance to clear my head.

Cheers to all
B
7
S
1
Posts: 18
Reputation: 361

Post » Tue Apr 14, 2015 8:48 am

I was thinking along the lines of making all guns different animations of the same gun-sprite.
That way an instance variable would be used to determine which gun to display and how the gun works.

gun if instance variable = bazooka
> fire Very big bullet

You could also use a boolean variable InUse set to true when the player is holding it and to false when it's on the floor.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
53
S
16
G
8
Posts: 6,157
Reputation: 19,744

Post » Tue Apr 14, 2015 11:05 am

Hmm interesting idea @LittleStain. I didn't think about making all the guns the same sprite and then just using Instance Variables to set frame/animation.

It's something that I'll definitely have a look into, but it's unfortunately going to have to go on hold for the moment, as I have too much real-world work taking up my time. Hopefully I'll get back into it in the next week or two.
B
7
S
1
Posts: 18
Reputation: 361

Previous

Return to How do I....?

Who is online

Users browsing this forum: Myrmex, Yahoo [Bot] and 1 guest