Having trouble un-pinning...

Get help using Construct 2

Post » Tue May 14, 2013 12:36 pm

Hi, I'm trying to make a certain thing happen wherein the player object overlaps the 'puck(or ball)' object, the puck sticks to the player object until the player then left clicks and the puck object is fired in the direction of the players mouse pointer.
I've included the event sheet I've came up with while tooling around with this idea to make my question slightly less of a jumbled mess.(apologies in advance, i really have tried to think of a clearer way of wording all of this)

From said messing around, I've managed to get the puck to pin to the player object when it overlaps with it and that's all well and good(i also managed to set the position to the player x and y co-ordinates such that it would overlap the center of the player rather than stick round the edges).

I set the physics to immovable for both player and puck to fix an error i had where it would shoot all over the screen even when the keys weren't pressed. So now I wan't to be able to click-hold to charge up a shot and then release to unpin to puck object from the player and shoot it towards the mouse cursor. I've tried setting an apply physics force to mouse.X and mouse.Y but to no avail, it just stays pinned there and i don't know how to proceed. Any help would be greatly appreciated if you can find the time,

Thanks, one grateful newbie!
B
5
Posts: 47
Reputation: 392

Post » Tue May 14, 2013 12:37 pm

If you can't see the image for some reason or another, here's the link : https://dl.dropboxusercontent.com/u/151998804/eventSheet.png
B
5
Posts: 47
Reputation: 392

Post » Tue May 14, 2013 12:56 pm

Debugging with the Developer Console

I think it would help you to use ths extension, with it you can post to the developer console of your browser. This means you can easily check in every situation if the object is unpinned or not.

You can also check if events get trigered.

If this alone doesnt help you, you should give us an example .capx or a better (bigger picture)
B
15
S
6
G
6
Posts: 512
Reputation: 5,550

Post » Sat May 18, 2013 2:41 am

Thanks, i can't seem to get the plugin working but i'll keep trying!

Paul.
B
5
Posts: 47
Reputation: 392

Post » Sat May 18, 2013 3:12 am

I can't see any "release puck" code , but It's probably due to the puck still overlapping player setting haspuck true continuously...

A good idea would be set it to a position just outside the players collision box on release...Pixel perfick2013-05-18 03:14:03
As long as I can move left, right and fire, I'm Happy...
B
42
S
15
G
11
Posts: 655
Reputation: 12,260

Post » Sat May 18, 2013 4:45 pm

Thanks for the reply again pixel, I managed to fix this by going and re-doing my whole event list more coherently. It all just sort of fell into place and i have it working now.

Paul.
B
5
Posts: 47
Reputation: 392


Return to How do I....?

Who is online

Users browsing this forum: LeFuji, Yahoo [Bot] and 24 guests