Cintra's Forum Posts

  • 4 posts
  • Hello!

    How can i make the host receive the broadcast message sent from himself?

    I mean, i want to send a "peer message" that will be received by ALL the connected players, including the host.

    I think that it's very simple but i don't know how to do without using multiple lines :c

    Thanks

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • This would do it. Note the tab means it's a sub-event.

    repeat distance(sprite.x,sprite.y,mouse.x,mouse.y) times
    --- sprite: move 1 pixel at angle(sprite.x,sprite.y,mouse.x,mouse.y) degrees
    	sprite: overlaps wall
    	--- stop loop
    	--- sprite: move -1 pixel at angle(sprite.x,sprite.y,mouse.x,mouse.y) degrees[/code:39zjoyl7]
    
    Edit:
    Opps, that will do it instantly
    
    You can make it move gradually, say 100 pixels per second, with the following:
    [code:39zjoyl7]repeat min(distance(sprite.x,sprite.y,mouse.x,mouse.y), 100*dt) times
    --- sprite: move 1 pixel at angle(sprite.x,sprite.y,mouse.x,mouse.y) degrees
    	sprite: overlaps wall
    	--- stop loop
    	--- sprite: move -1 pixel at angle(sprite.x,sprite.y,mouse.x,mouse.y) degrees[/code:39zjoyl7]
    

    Thanks!

  • Give the player pathfinding, have an event for when the mouse is clicked to set the pathfinding to that point, then when the path is found make the player walk the path.

    But the pathfinding will ignore the wall. I didn't say about these detail, sorry.

    The player must receive an impulse and he will only stop if reach the mouse position or some wall.

    He need to go in a line.

  • Hello!

    It's my first post here, sorry for anything.

    I want to click in some screen location and make the player move until reach that mouse location that i clicked.

    How can i do it?

    Thanks!

  • 4 posts