How do I Stop the player from leaving the screen

  • 6 Parts. The super simple way (you misunderstood 'layout' in BoundToLayout).

    https://www.dropbox.com/s/qp8ylpczixfrt ... .capx?dl=0

    Thanks once again 99Instances2Go I will look at this <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

  • timcs, this is ofcourse made for basic needs, and it answers your first question.

    If you need the parts to have displaced origins, then we got to go a step further.

    If the parts need to be able to (by instance) rotate or scale, when we got to take it 5 steps further.

    Need to know your needs.

  • timcs, this is ofcourse made for basic needs, and it answers your first question.

    If you need the parts to have displaced origins, then we got to go a step further.

    If the parts need to be able to (by instance) rotate or scale, when we got to take it 5 steps further.

    Need to know your needs.

    Hi 99Instances2Go

    the objects are all pined together at the start of the game, I then , when each part was used to be dragged, switched the pin method around. From your capx (and I cannot see how you have done this) you have managed to have all of the parts "stuck" together within the playerbox and it appears that the dragging is driven from the player box only.

    This would simplify my process some what but I cannot see how you have managed to get the player parts to stay together when I click inside the box.

    Thanks

    TimCS

  • The player parts are instances of the same object 'player', so, without picking, 1 action moves them all. They just have another animationframe (can be done with animations too)

    Catch: they all have the same origin.

  • The player parts are instances of the same object 'player', so, without picking, 1 action moves them all. They just have another animationframe (can be done with animations too)

    Catch: they all have the same origin.

    OK, could this way of working affect the collision of the objects because the reason why I used the "pin" method was that I only wanted one part of the player object to actually collide and interact with the enemy and the other parts to just be used for dragging/moving the player about

    Thanks

    TimCS

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Do the collisions on the bounding box ? With correct polygons.

    The the bounding box is what moves the whole system anywayz.

  • Do the collisions on the bounding box ? With correct polygons.

    The the bounding box is what moves the whole system anywayz.

    If I do that then it would mean that moving the player would be limited to one area of the box as the collision is where the dragging is based on is it not? . So this player is a "brush" with a handle, brush head and bristles, I only want the Bristle to interact with the enemy so making the collision on based in that area would mean that the dragging would only work there would it not ?

    Thanks

    TimCS

  • Thats true, the collission polygons of the box keeps things inside the layout. That was a very bad suggestion.

    I dont know if this 'collission' is supposed the act a 'physics collision', i suppose not.

    Then i dont see a problem.

    Give the player parts an identification instance variable, say 'id'.

    Player instance variable 'id' = bristle.

    On (player) overlapping (enemy)

    ............ do stuff

  • Thats true, the collission polygons of the box keeps things inside the layout. That was a very bad suggestion.

    I dont know if this 'collission' is supposed the act a 'physics collision', i suppose not.

    Then i dont see a problem.

    Give the player parts an identification instance variable, say 'id'.

    Player instance variable 'id' = bristle.

    On (player) overlapping (enemy)

    ............ do stuff

    Not sure if the overlapping logic will work correctly for this game as the idea is to create a brushing effect ,. as if the player object is just overlapping the enemy object then the "brushing effect" is not really going to happen as well as I have tried to use it so can this method you have mentioned work with on collision ?.

    At the moment I am using the on collision statement with the bristles on the enemy .

    Thanks TimCS

  • Lets converge.

    If this works:

    https://www.dropbox.com/s/qrtegi0qmx6a4 ... .capx?dl=0

    What do i miss ?

  • Lets converge.

    If this works:

    https://www.dropbox.com/s/qrtegi0qmx6a4 ... .capx?dl=0

    What do i miss ?

    This could work I presume the playerbox does not have to had a border around it ? will have to try this is out with the type of brush I am using with the game. Again thanks a lot 99Instances2go and have a good Christmas.

    Regards

    TimCS

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