How do I fix this issues?

0 favourites
  • Hello to everybody i'm quite new into this world and I start trying develop like 4 or 5 days ago.

    I'm trying to recreate some games I see around just to understand how they works.

    I'm having hard times with this:

    Blocks falling from the top and the hero has to catch them into his tray. Every object he has in the tray should upload global variable layers_on_the_tray (because when he reaches 4 the game has to stop).

    I'm having hard times with 3 issues:

    1-

    :

    not all the time but when I grab something in my tray I can normally go into the left but I find very hard to go in the right (sometimes left as well but most of the times the problem is moving to the right)

    2- I would like to avoid what happens into

    -> When I fastly move, the stuff I get in the tray falls. Is there any way?

    3- I need to perform some action (as told add value 1 to layers_on_the_tray variable) when I have something correctly in my tray. I’ve try almost all of the platform option but I can’t get in through it.

    Here is my code: https://drive.google.com/file/d/1RJuafc4DVNEI_lAdhJCdxq4JCvpOkWHW/view

    Does anybody have some suggestion? Thanks!!

  • I think there is something wrong with the videos:

    n.1

    Subscribe to Construct videos now

    n.2

    Subscribe to Construct videos now
  • Hey there, I can't check your project rn but I watched the two videos, for the blocks falling of the plate, you should use the pin behavior to pin them to the character, so they will follow their movements, now for the character moving slowly to the right, have you checked the character collision polygon in the image editor? Also which behavior do you use to move the character?

  • Hi Tomy and Thanks for you answer.

    So...

    1-

    you should use the pin behavior to pin

    I will try the pin behavior as soon as i solve the point n.3 (understand when a block is in the tray)

    2-

    now for the character moving slowly to the right, have you checked the character collision polygon in the image editor

    I did something 'strange'. I want to grab only blocks that fall in the tray and not in the men so i use the collision polygon only in the tray

    3-

    Also which behavior do you use to move the character

    My character is a solid and a platform

    Thanks!!

  • Ok so, the way you handle the collision is actually not a bad idea, you should just limit the polygon points to 4, basically a flat rectangle;

    Now for the movement behavior, I think 8-Movement is more adapted to your need, you can even limit the movement range to Left/Right in the parameters, be sure to toggle off "Set Angle" tho;

    Going back to the collision polygon, one problem that adds to the pile is how to prevent the character to go out of boundaries, for that the clamp expression can be useful, are you familiar with it?

  • Ok so, the way you handle the collision is actually not a bad idea, you should just limit the polygon points to 4, basically a flat rectangle;

    Did it!

    Now for the movement behavior, I think 8-Movement is more adapted to your need, you can even limit the movement range to Left/Right in the parameters, be sure to toggle off "Set Angle" tho;

    I tried but still gives me problem when i have something in my tray

    Going back to the collision polygon, one problem that adds to the pile is how to prevent the character to go out of boundaries, for that the clamp expression can be useful, are you familiar with it?

    Not familiar for now. To avoid him to go outside i did set the hero as solid and i placed 2 solid wall in the side (in the picture its the 2 grey rectangle) so the tray in never going outside

  • So as long as the tray is on screen it's fine, no need for clamp then;

    Also I didn't suggested the 8-Direction to fix the box falling problem, only to make the movement management more streamlined, to fix the said problem, the pin behavior should fix it, by checking when a box collide with the tray or another box, pin it to the character position;

    However there is just one tiny problem, without the family feature, there's no way to check if a box collide with another box correctly, because C3 wouldn't know which one to pick and pin to the player, there's a solution however : have an invisible object that is placed on the tray and follow its X coordinates, that would check when a box touch the top of the pile;

    Each time a box touch that checker, it is pinned to the player, and the checker is moved a few pixels up, do you see what I mean?

    EDIT : Nevermind I though of a simplier solution, what do you use to make the boxes fall?

  • Also I didn't suggested the 8-Direction to fix the box falling problem, only to make the movement management more streamlined

    Sure i understood but even with the 8 direction i got the same problem:

    Subscribe to Construct videos now

    However there is just one tiny problem, without the family feature, there's no way to check if a box collide with another box correctly, because C3 wouldn't know which one to pick and pin to the player, there's a solution however : have an invisible object that is placed on the tray and follow its X coordinates, that would check when a box touch the top of the pile;

    Will try this!

    EDIT : Nevermind I though lf a simplier solution, what do you use to make the boxes fall?

    I use Gravity

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • As I said, 8-Direction is not to fix the problem;

    Now if you're already using plateform for the boxes that's perfect, you just need to use "On landed" condition in the events, then "Pin to Object" to pin it to the player object

  • Now if you're already using plateform for the boxes that's perfect, you just need to use "On landed" condition in the events, then "Pin to Object" to pin it to the player object

    Well, the pin solved the falling box on movement. Im still getting problem with movement

    Subscribe to Construct videos now
  • Ah you meant the slow moving to the right, I think it is because of the player colliding with the boxes while moving with them at the same time, it creates a friction, try to disable solid behavior on the player and pin the first box by checking "On collision with another object" instead

  • mmmm, it seems not being a solid creates me even more problem

  • Subscribe to Construct videos now
  • Now that's very weird, I'll see if I have some time to inspect the file later on

  • Thank you! i uploaded latest version here: https://drive.google.com/file/d/1RJuafc4DVNEI_lAdhJCdxq4JCvpOkWHW/view?usp=sharing

    btw it seems happening less often then before since i add the pin behaviour

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