Picking up Objects

Get help using Construct 2

Post » Sat Feb 11, 2012 10:22 am

Hi Guys,

I'm trying to build a funcion where a player picks up a box or something and then is able to throw it to the ground again. I'm completely new to construct so I was wondering if any of you might have a CAPX file to show the functionalityof something like that.

Great Thanks,

Jana
B
4
Posts: 17
Reputation: 434

Post » Sat Feb 11, 2012 11:33 am

Quick thought.
For picking up the box You could use Pin behavior with your box and then
+On "space" pressed -> Pin box to Player - that will make box stay always relative to the player position.

For throwing, well it depends what "style" you are tring to achieve.
You could use Physics, Bullet, custom made events...
ImageImageImageImage
B
140
S
58
G
36
Posts: 2,547
Reputation: 31,170

Post » Sat Feb 11, 2012 1:34 pm

Allright great,

the "pin box to player" already worked out great. I'm browsing through the Physics docs right now to see how far I get. Any other tips are welcome.

Cheers,

J
B
4
Posts: 17
Reputation: 434

Post » Sun Feb 12, 2012 11:28 am

Interessting, that you post your question twice under different topics...

...but this is a real chalange as I can see so far....
B
42
S
19
G
12
Posts: 723
Reputation: 13,911

Post » Sun Feb 12, 2012 11:41 am

THIS could be a possible solution BUT...

@Ahley - this shows again that "physics" is somewhat buggy. I know, plattform and physics don't like each other - but if you try the CAPX you will see, that the whole thing sometimes works and sometimes it does not...but why?!?
B
42
S
19
G
12
Posts: 723
Reputation: 13,911

Post » Sun Feb 12, 2012 3:09 pm

Extract from the basic physics tutorial:
[quote]For example, if you use Set Position to move an object to the other side of the layout instantly, it has effectively teleported. That's not a realistic physical phenomenon, so the result may be unrealistic as well.[/quote]

Event2 and event6 you teleport the box.

Check out : Player (platform behavior) and Physic (world objects) - LINK, listed in the how do I FAQ, i think it does in fact spawn/displays either physic, either platform objects, depending on the state.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Sun Feb 12, 2012 4:25 pm

Yeah sorry about the second post, but I thought I would have to use another way. I didn't get to far through the documentation today, but I used some of the tips I got and this is what I have so far: http://dl.dropbox.com/u/23570533/Game.capx

The box is unpinned and it gets thrown away (sort of at least). I'll brows through the docs some more to find out how to make it land on the bottom and make it fly in a certain angle.

I stopped combining Platform and Physics for the "Player" sprite and will just use events to trigger simple movement.
B
4
Posts: 17
Reputation: 434

Post » Sun Feb 12, 2012 4:40 pm

[QUOTE=Kyatric] Extract from the basic physics tutorial:
[quote]For example, if you use Set Position to move an object to the other side of the layout instantly, it has effectively teleported. That's not a realistic physical phenomenon, so the result may be unrealistic as well.[/quote]

Event2 and event6 you teleport the box.

[/QUOTE]

Kyatric - I know all this, and I also know, that Tom and Ashley have loads to do...but if you look around in the board and if you realy tweak the physics objects you will find quite a few things that can allways be blamed on the interaction betweent different behaviours, BUT at some point in time you come to the conclusion, that a commercial product should have either a full working engine, or claim on the start page in flashing letters, that some features can not be used with others.....

Sorry, for this long thought....

And most of the time, the "unrealistic" things are to work around other stuff that does not work (as expected)Weishaupt2012-02-12 16:42:10
B
42
S
19
G
12
Posts: 723
Reputation: 13,911

Post » Sun Feb 12, 2012 6:15 pm

[QUOTE=janajost] Yeah sorry about the second post, but I thought I would have to use another way. I didn't get to far through the documentation today, but I used some of the tips I got and this is what I have so far: http://dl.dropbox.com/u/23570533/Game.capx

I stopped combining Platform and Physics for the "Player" sprite and will just use events to trigger simple movement.[/QUOTE]

----------------------------------------------------
Try it this way:

Throw box

Left click to pick up the box.
Release to throw.
B
19
S
6
G
7
Posts: 1,205
Reputation: 7,298

Post » Sun Feb 12, 2012 7:54 pm

@ChrisRobs,

Thanks a bunch, this will give me a lot to play around with.
B
4
Posts: 17
Reputation: 434

Next

Return to How do I....?

Who is online

Users browsing this forum: bluemonkey, Khamsou and 23 guests