How do I limit weapons so player is out of weapons/bullets?

Get help using Construct 2

Post » Sat Jun 06, 2015 5:19 am

So its like there are limited bullets. say 5 , after which player has to again take the weapon addon to reset the bullets to 5 again.
how do i do this?
B
4
Posts: 27
Reputation: 254

Post » Sat Jun 06, 2015 6:47 am

I highly recommend you to do the bigeinner tutorial if you haven't yet.
It introduce you to use instance variable and global variable, which should do the trick

https://www.scirra.com/tutorials/37/beg ... t-2/page-1

gl!
It's time for me to return the favor :)
B
32
S
9
G
9
Posts: 132
Reputation: 5,370

Post » Sat Jun 06, 2015 9:08 am

Hi i already did this ,
i want to implement like ...

say if player instance variable weapons is less than 1 , then even after pressing attack object , the player should not spawn the weapon . HOW TO DO THIS PART???

What is the option for NOT SPAWNING AN OBJECT EVEN AFTER PRESSING THE KEY??
B
4
Posts: 27
Reputation: 254

Post » Sat Jun 06, 2015 9:15 am

Simply add a condition

player on key pressed
player compare variable weapons > 0
> player spawn bullet

This way only if the variable is above 0 a bullet will be spawned..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sat Jun 06, 2015 9:35 am

this is so simple and fantastic , i love the flexibility of construct 2. Awesome!
B
4
Posts: 27
Reputation: 254

Post » Sat Jun 06, 2015 2:41 pm

kiranchandra you will find many demo tutorial in below link

https://www.dropbox.com/sh/eioscti86bpr ... 7YPza?dl=0
B
252
S
39
G
15
Posts: 1,964
Reputation: 40,763


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 35 guests