How do I add lasers?

Get help using Construct 2

Post » Tue Aug 01, 2017 9:20 pm

hi in my app i need to add lasers who are shoot from the cockpit of my ship, how to make the sprites go very far to the center of the screen?
here is my ship cockpit (wip).

https://s3.postimg.org/42on5ok4h/ship.jpg

Image
Last edited by imothep85 on Thu Aug 03, 2017 5:42 am, edited 2 times in total.
B
37
S
15
G
7
Posts: 1,680
Reputation: 9,612

Post » Wed Aug 02, 2017 11:01 am

can someone help?
B
37
S
15
G
7
Posts: 1,680
Reputation: 9,612

Post » Wed Aug 02, 2017 1:06 pm

Something like this?

https://www.dropbox.com/s/fcst2wdhp2i4f ... .capx?dl=0

Left click to shoot to mouse point,
Right click to shoot to screen centre.

You could also add in some fancy stuff like particle effects that move from the laser origin to the mouse co-ords/screen centre.
B
19
S
8
G
3
Posts: 429
Reputation: 3,972

Post » Wed Aug 02, 2017 1:21 pm

thanks a lot mekonbekon :D that is going to be perfect :D
B
37
S
15
G
7
Posts: 1,680
Reputation: 9,612

Post » Wed Aug 02, 2017 1:28 pm

@imothep85

No worries :)

You might also find this useful for other weapon effects:

https://www.dropbox.com/s/hrr7lggb5b3sh ... .capx?dl=0
B
19
S
8
G
3
Posts: 429
Reputation: 3,972

Post » Wed Aug 02, 2017 9:33 pm

mekonbekon can you explain me how to control the red bullets in your capx, firing with the joypad xbox if i push the button B for firing, and control the directions with the analog left joystick?
i dont use the mouse for my game, thanks
B
37
S
15
G
7
Posts: 1,680
Reputation: 9,612

Post » Thu Aug 03, 2017 8:23 pm

Hi @imothep85

I haven't used the joypad plugin, but I would guess that you could use:

Axis(Gamepad, Index)

...to move an invisible object on the screen, and then use the co-ordinates of that object in place of the mouse (x,y).
B
19
S
8
G
3
Posts: 429
Reputation: 3,972

Post » Fri Aug 04, 2017 6:06 am

i solved it using your file and doing some changes :D mekonbekon
B
37
S
15
G
7
Posts: 1,680
Reputation: 9,612


Return to How do I....?

Who is online

Users browsing this forum: Baidu [Spider], evillair, mongoose665 and 56 guests