Navigation

    CreatiCode Scratch Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • CreatiCode

    How do I make a 2d game that's multiplayer?

    Help
    2d-blocks multiplayer question
    3
    7
    329
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • NotJaldolfYT
      NotJaldolfYT last edited by jeffreyrb03-gmail

      As the title states, how do I make a 2d game that’s multiplayer? i’m trying to make my game have clones of the players that will act as other players.

      i have toddler humor

      Tyller_ 1 Reply Last reply Reply Quote 1
      • Tyller_
        Tyller_ Best Forum Helpers @NotJaldolfYT last edited by

        @jd131111 You use the multiplayer extension, creaticode has an example and if you want something specific I can provide a demo (though my methods of using stuff can be a bit elaborate)

        <div component="post/signature" data-uid="255" class="post-signature">Check out my chat room project so you ppl can not use forums as chat rooms! https://play.creaticode.com/projects/66f2e1dcd1be43d82b886fbd?version=1 <p dir="auto">
        </div>

        NotJaldolfYT 1 Reply Last reply Reply Quote 2
        • NotJaldolfYT
          NotJaldolfYT @Tyller_ last edited by NotJaldolfYT

          @tyller_ Okay, thank you 😄 i’ll try learning how to use it, if I need help, I’ll just comment on the forum about it 😄

          i have toddler humor

          Tyller_ 1 Reply Last reply Reply Quote 0
          • Tyller_
            Tyller_ Best Forum Helpers @NotJaldolfYT last edited by

            @jd131111 https://play.creaticode.com/projects/6613fb5b564fc287b0e8cfc2

            is the link, I have a project if you want variables synced across all clients (my project is formatted like an api where you just use custom blocks that you drag into any sprite in your project, and those are just used to send formatted broadcasts to interact with it)

            <div component="post/signature" data-uid="255" class="post-signature">Check out my chat room project so you ppl can not use forums as chat rooms! https://play.creaticode.com/projects/66f2e1dcd1be43d82b886fbd?version=1 <p dir="auto">
            </div>

            NotJaldolfYT 1 Reply Last reply Reply Quote 1
            • NotJaldolfYT
              NotJaldolfYT @Tyller_ last edited by

              @tyller_ How do I make a clone of the players model and make it go to the position of where the seconds player client, send it to the server, then send it to the first players client, updating the position?

              (also, how do I make the players model appear on clients?)

              i have toddler humor

              Tyller_ 1 Reply Last reply Reply Quote 0
              • Tyller_
                Tyller_ Best Forum Helpers @NotJaldolfYT last edited by Tyller_

                @jd131111 This one is when you add a clone to the game with the add sprite to game as shape block, it will run the “when added to game” hat block as that clone which is then spawned on all clients, also it makes it so whenever a new player connects to the game, it will spawn that clone for them and run the “when added to game” on that client example below
                (In this example assume that you set in the prepare for green flag hat block to create/join the same world, so everybody is connected to the same world)

                On green flag click /
                Create clone of myself with id (username)

                When I start as clone /
                Add this sprite to game as [rectangle]

                When added to game /
                log to console (clone id)

                when the first player (lets say their username is “playerone”) joins, it will log on their client “playerone”
                When the second player joins (lets call them “playertwo”) it will log in their console (playertwo’s console) the message “playerone” because the clone that the first player added to the game gets spawned on this players client and runs the when added to game block,the then both clients (playerone and playertwo) will log “playertwo” because playertwo’s clone is now added to the game (edit: and spawned on the other players client), I can make a demo project if this is too confusing (edit: you repeat this logic for all players, and a side note, the clones positions are synced when they spawn in, but to keep their positions in sync you have to use the method shown in the 2 player space shooter example by CreatiCode, where you rely on the sync set speed to move them)

                <div component="post/signature" data-uid="255" class="post-signature">Check out my chat room project so you ppl can not use forums as chat rooms! https://play.creaticode.com/projects/66f2e1dcd1be43d82b886fbd?version=1 <p dir="auto">
                </div>

                1 Reply Last reply Reply Quote 1
                • ?
                  Guest last edited by

                  hi my name is gennesis i love yuo

                  1 Reply Last reply Reply Quote -1
                  • First post
                    Last post