[Help]Battleship game

This forum is currently in read-only mode.
From the Asset Store
five golem elements Sprites Sheet.Best for enemy or villain game characters.
  • Hey, Ive read both tutorials of construct but i still have one question: How do i create a turn based game? for example as simple as battleship? i have this very good game idea that was created long time ago, but was played on quadrille paper. Im now thinking of making it on construct and i intend to start as a battleship style game and work it from there.

    Thanks in advance

  • What's the problem for you exactly ?

    Turn-based game isn't much harder (or easier) to create than real-time

    Just specify your question, please, ok?

    -edit-

    But I guess anyway you should try Grid Movement Behavior, maybe RTS Behavior. It can clear something.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • well what i dont know how to do, is to make player 1 make a move, and then player 2 make a move.

    can anyone add me to msn and give me some help?

    cheers

  • You can do this by setting the state of the game with a variable, whether it's global or private. Restrict the movements and actions based on what the variable says.

    + Global('currentPlayer') = 1
        -> Activate player one movements
    
    + Global('currentPlayer') = 2
        -> Activate player two movements
    [/code:1bittg34]
    
    At the end of a turn, you switch the global variable to the next player.
    
    If you're clever you can even control both sets of players with the same code, by marking the player pieces with variables as well.  That way if global('player') is currently set to 1, for example, then clicking on player two's pieces will do nothing.  And vice versa.  Or whatever.
    
    You would just need to have PV's for every player piece that can hold a 1 or 2 to distinguish which player it belongs to.  You can even use the same sprites!  Just have different animations in the sprite for player 1 and 2... say, one set of ships colored red in one animation, and another set of ships colored blue in another animation.  Set the animation to the proper color by checking what the player PV is.
    
    Go ahead and try it out, if you need help with it then post a .cap file showing what you've tried so far.
  • You can do this by setting the state of the game with a variable, whether it's global or private. Restrict the movements and actions based on what the variable says.

    > + Global('currentPlayer') = 1
        -> Activate player one movements
    
    + Global('currentPlayer') = 2
        -> Activate player two movements
    [/code:31ighzeg]
    
    At the end of a turn, you switch the global variable to the next player.
    
    If you're clever you can even control both sets of players with the same code, by marking the player pieces with variables as well.  That way if global('player') is currently set to 1, for example, then clicking on player two's pieces will do nothing.  And vice versa.  Or whatever.
    
    You would just need to have PV's for every player piece that can hold a 1 or 2 to distinguish which player it belongs to.  You can even use the same sprites!  Just have different animations in the sprite for player 1 and 2... say, one set of ships colored red in one animation, and another set of ships colored blue in another animation.  Set the animation to the proper color by checking what the player PV is.
    
    Go ahead and try it out, if you need help with it then post a .cap file showing what you've tried so far.
    

    Okay,thanks alot!

    Im going to try that, tho after reading some, i dont think construct is the most indicated software to build this game since multiplayer would become difficult on the long run i.e. lan/online game. But still im going to see what i can do.

  • Okay,thanks alot!

    Im going to try that, tho after reading some, i dont think construct is the most indicated software to build this game since multiplayer would become difficult on the long run i.e. lan/online game. But still im going to see what i can do.

    Yeah, it would be kind of hard to make a networked game right now, seeing as how there is no network plugin. But just be patient... it will come eventually.

  • If it's turn-based, you can probably get away using the HTTP object and an external server as a mediator, and you could hide the lag using "lengthy" (as in: a few hundred milliseconds at least) animations.

    Also, for turns you'd probably want to use the "Trigger once while true" condition. Read about it, you'll use it a lot in this scenario.

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