How do I do a click-and-hold charge up shot?

Just started using Construct 2? Post your questions here

Post » Tue Sep 02, 2014 11:07 pm

Hey guys!

Brand new to Construct 2, finished the tutorial, I wanna add a megaman style click and hold charge up shot which will do twice the damage.

Already made the graphic for both the bigger bullet, and the "charge" flash which really I am just doing a slow fade in. Also I know how to double the damage done.

My only real problem is with the mouse options there seems to be no click and hold after x amounts of seconds then do x command (like spawn bullet flying at hideous monster).

Assuming I have to work with the while left click is down command I just don't know how. Or possibly on click release? :?:

Already messed around with a few things but I feel I am stuck at this point.

Any feedback, pointers would be tanfastic. Thanks!
B
3
Posts: 2
Reputation: 179

Post » Tue Sep 02, 2014 11:31 pm

( Global or local variable can also be object variable )
Add Variable Charge set to 0
Add Variable Damage set to 2

( Event for the "Charging" effect )
Event :
If Charge = 0 ----> Damage = 2
If Charge = 1 ----> Damage = 3
If Charge = 2 ----> Damage = 4
If Charge = 3 ----> Damage = 5

( Event for set the maximum charge of the Weapon )
Event :
Evry tick --->
Charge = ( Max Charge for exemple 3 seconds ) 3 ----> Set Charge to 3

( Event who define how many time you charge your weapon )
Event :
Evry 1 seconds ---->
On mouse button is down ---> add 1 to Charge

( Wepon event )
On Mouse button released ----> Spawn Bullet
-----> Set Charge to 0

( Ennemy Side )
Event :
On bullet overlapping ennemy ----> Destroy Bullet
-----> Substract Damage to Ennemy.Life

Hope it's what you need ! =)
B
21
S
9
G
3
Posts: 70
Reputation: 2,722

Post » Tue Sep 02, 2014 11:35 pm

Exactly what I needed thank you SO much!
B
3
Posts: 2
Reputation: 179

Post » Thu May 07, 2015 4:25 pm

oOScuByOo wrote:( Global or local variable can also be object variable )
Add Variable Charge set to 0
Add Variable Damage set to 2

( Event for the "Charging" effect )
Event :
If Charge = 0 ----> Damage = 2
If Charge = 1 ----> Damage = 3
If Charge = 2 ----> Damage = 4
If Charge = 3 ----> Damage = 5

( Event for set the maximum charge of the Weapon )
Event :
Evry tick --->
Charge = ( Max Charge for exemple 3 seconds ) 3 ----> Set Charge to 3

( Event who define how many time you charge your weapon )
Event :
Evry 1 seconds ---->
On mouse button is down ---> add 1 to Charge

( Wepon event )
On Mouse button released ----> Spawn Bullet
-----> Set Charge to 0

( Ennemy Side )
Event :
On bullet overlapping ennemy ----> Destroy Bullet
-----> Substract Damage to Ennemy.Life

Hope it's what you need ! =)



and if i have 4 different projectile sprite? there is the basic bullet, the lvl 1 charge, lvl 2 charge and lvl 3 charge how would i make that?
B
11
S
6
Posts: 19
Reputation: 1,086

Post » Thu May 07, 2015 4:28 pm

venoxis wrote:
oOScuByOo wrote:( Global or local variable can also be object variable )
Add Variable Charge set to 0
Add Variable Damage set to 2

( Event for the "Charging" effect )
Event :
If Charge = 0 ----> Damage = 2
If Charge = 1 ----> Damage = 3
If Charge = 2 ----> Damage = 4
If Charge = 3 ----> Damage = 5

( Event for set the maximum charge of the Weapon )
Event :
Evry tick --->
Charge = ( Max Charge for exemple 3 seconds ) 3 ----> Set Charge to 3

( Event who define how many time you charge your weapon )
Event :
Evry 1 seconds ---->
On mouse button is down ---> add 1 to Charge

( Wepon event )
On Mouse button released ----> Spawn Bullet
-----> Set Charge to 0

( Ennemy Side )
Event :
On bullet overlapping ennemy ----> Destroy Bullet
-----> Substract Damage to Ennemy.Life

Hope it's what you need ! =)



and if i have 4 different projectile sprite? there is the basic bullet, the lvl 1 charge, lvl 2 charge and lvl 3 charge how would i make that?


Couldn't you just use instance variables on the projectiles?
Oh If you mean you have different images for the different charge, the easiest way would be to use frames or animations for them and set them according to the projectile charge.
Or on bullet fired and charge=1 spawn lvl 1 charge, on bullet fired and charge=2 spawn lvl 2 charge
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



Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 3 guests