How do I make turns work correctly?

0 favourites
  • 8 posts
From the Asset Store
_______ Huge collection of metal fixtures ________
  • Hi All,

    I'm new here.

    Trying to create my first videogame, a sort of duels videogame.

    I have problems making turns working correctly. Can't understand why at some point something stops to work. I tried using functions and variable in different ways but the problem is still there :(

    Here is my project file.

    dropbox.com/scl/fi/b1p5zguye8zkatdcyia5d/Duels.c3p

    Could you please help me understand what to change to make it correctly working?

    Thanks in advance!

  • 'something stops to work' ? really that's all the info you can give us. well i see that the targeting stops working sometimes so the arrow keys are not working, if you mean this then double check the deactivating groups logic.

  • Thanks, for the fast reply.

    I mean:

    The variables seems that are correct for let functions to work correctly but seems that functions does not start as intended after few turns, randomly.

    I usually check if turn is Player1 or Player 2 and if the variables Punto, Angolo and AngoloImpostato are correct as per conditions and they are, but the turn won’t change to other player.

    Sorry I did not get the point of what you said to verify, could you better explain me?

    Thanks a lot

  • I didn't really see any problem with changing to the other player. Sometimes the arrow keys stop working when it is a player's turn this is probably to do with your activating/deactivating groups.

  • Another thing is that TurnN is supposed to add +1 at the end of each turn, independently if is point or not.

    I don’t understand why if it is point, this variable correctly increments by 1. If it is not point it seems that it add a random number (like ticks number).

  • Another thing is that TurnN is supposed to add +1 at the end of each turn, independently if is point or not.

    I don’t understand why if it is point, this variable correctly increments by 1. If it is not point it seems that it add a random number (like ticks number).

    There are a few bugs around. You could do with trimming down the logic tbh. I see a problem at line 68 where this could run a lot of times so this means you are running that function every tick and maybe contributes to the variable

  • Why that function runs few time if it is inside an event that should be generated only one time if true?

    I don’t understand this :(

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Why that function runs few time if it is inside an event that should be generated only one time if true?

    I don’t understand this :(

    It's not, you've put the condition outside of the event on its own instead of as a sub event. Or if it's meant to be on its own then it needs a trigger once.

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