How do i aim..

Get help using Construct 2

Post » Sun Jul 02, 2017 12:31 pm

Message: clissy09 can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Hi, i want the block to stay STILL when i click and hold on it. And i want it to Shoot towards where i have my cursor. As you can see, it just jumps and bobs about whenever i click and WHEREVER i click. i don't even have to click ON the Block, it still moves.

Depending on how far away my cursor is from the block when i LET GO of the click, is how far i want the block to shoot.

So, 1) How do i "Aim" the block without the block moving when i click on it.
2) How do i set it so the distance of the cursor from the block is how powerful the throw is.
3) how do i Stop the block from moving when i click anywhere.

GIF of problem: https://gyazo.com/c46d1d8704ff0d2f05efac99a07181a2

Image of my current event list.

Image

i have no idea what i'm doing.

You could say it is similar to "angry birds" but i don't want the catapult Mechanic and i Can't figure out how to do what i want it to do by looking at the Event List for the Catapult Physics template game.

Any help is appreciated. I will be going to work for 8 hours now, so i may reply when i get home.

Thanks!
B
4
Posts: 19
Reputation: 240

Post » Sun Jul 02, 2017 2:25 pm

You could always make a sprite that looks like your player but has no physics behavior attached. It simply shows a visual of what you want when the player sets power (ie. by looking at mouse but staying put). You would then just need to destroy fake, spawn real and apply your data to it on creation that you stored in variables.

It sounds like from your description though you might be looking more for an arrow and less catapult type launching...
Look at this .capx and see if it helps. It uses a delta time velocity increase based on mouse button down but you could change the formula to calculate distance cursor is from the player as well.
https://1drv.ms/u/s!ApREGYJdm9zRgTg22-eF6bRHhSpp
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
69
S
18
G
8
Posts: 639
Reputation: 9,549

Post » Mon Jul 03, 2017 11:19 am

ok, thank you, i think you may have just given me a new mechanic for my game! lol

but it all looks very complicated. Could i please ask that you give me a breakdown of what each of the different variables are?

like xhand and yhand and stuff?

I'd be very grateful.
B
4
Posts: 19
Reputation: 240

Post » Mon Jul 03, 2017 9:15 pm

Those are just used to store where the archers "hands" are... they are simply the X and Y coordinates so the arrow knows where it should be.

They currently set it to the player sprites X and y-32 so it appears somewhat where the hands would be...

They are just storing a place in X,Y space...
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
69
S
18
G
8
Posts: 639
Reputation: 9,549


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 6 guests