Picking up Objects

0 favourites
  • 14 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • 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

  • 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...

  • 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

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

    ...but this is a real chalange as I can see so far....

  • THIS could be a possible solution BUT...

    - 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?!?

  • Extract from the basic physics tutorial:

    or 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.

    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.

  • 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: 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.

  • Extract from the basic physics tutorial:

    or 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.

    Event2 and event6 you teleport the box.

    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)

  • 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: 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.

    ----------------------------------------------------

    Try it this way:

    Throw box

    Left click to pick up the box.

    Release to throw.

  • ,

    Thanks a bunch, this will give me a lot to play around with.

  • ,

    Thanks a bunch, this will give me a lot to play around with.

    ---------------------------------------------

    As the example shows, you are better sticking with the 'platform behaviour' for a platform type character(physics is a not ideal)

    Mixing the behaviours on a object will result in problems.

  • Idd, I thought using animation wouldn't work out allright but it did. Just one quick question though, how did you figure out the positon Player.Y-60 for the object to be created there?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Idd, I thought using animation wouldn't work out allright but it did. Just one quick question though, how did you figure out the positon Player.Y-60 for the object to be created there?

    -------------------------------------------

    Its the difference between 'Marios' image point, and the 'Box' image point.

    If Mario is 100px high, and the box is 100px and both have centered image points, you would use player.Y-100...I think?

  • Yes thats it, just the number of pixels on the Y ax relative to the player. Thanks !

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)