MudbuG's Recent Forum Activity

  • I am interested to see what progress has been made on your boilerplate. Have you created a GitHub project by any chance?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I am curious to know, why do you need to use both WebRTC and Socket.io? Does your game switch depending on capability of the client browser?

  • If the level is numeric, then define it as a Sync instance variable on a sync object.

    If the level is a string, you can use SendMessage to get the information to everyone.

  • What I have done is prevent the ability of a peer to create a room depending a hash value in the URL. For example, if my game URL is "awesomegame.com", to be a host the peer would need to enter a URL with a "secret" hash similar to "awesomegame.com/#secretHash" or "aweseomgame.com/#host"

    Here is how to use it:

    After logging in, but before joining a room, add a System condition to compare two values. Compare Browser.Hash to whatever you want the "secret" to be. Compare: Browser.Hash Equal to #mysecret

    If the user is allowed to be host, create a new room with a unique name. For testing I simply used the Multiplayer.MyID for the room name.

    If the user is not allowed to be host, get a list of rooms. If no rooms are joinable, tell the user that there are no Hosts or servers, or whatever message you want to say... or tell them to send you an angry email

  • The bandwidth profile of the Multiplayer object is set to internet by default, which means it does not send updates as frequently as you are expecting, even though you are on the local PC.

    Try using the Set bandwidth profile action ... to LAN. Keep in mind that if your game is intended for online internet play, you will need go back to Internet profile for that.

  • Attempting to test multiplayer. In C2 I would simply open a 2nd browser tab with same URL as the first one. This does not work for me using C3. Should it?

    Also, if I refresh the first window, it will not load.

    -DamonZero

  • Thanks to all! I have what I need for now.

    To fill your curiosity (or feed it more), here is a little more information about the game I am making:

    It is grid-based

    All objects in the game are the same size and are aligned to the grid (except during a move-to transition)

    It is not a match three game

    enemies change state when surrounded on four sides (maybe 8 later -- including diags) by either other enemies or solid objects (hence this "surrounded" test)

    The test capx files that I used here destroy the test object just so that I can see the test is working. In game the enemies simply change state when surrounded.

  • With your help, I found one way to solve this using a family. Here is the solution that I found:

    For the purpose of this test, it is done once start of layout so event looks like this:

    (please excuse poor representation of actual events... I need to learn how to represent this better in text)

    at start of layout
    for each Sprite     -> Sprite set scale 1.1
         Sprite is overlapping Surrounders (this is a family with memeber Sprite in it)
         Surrounders.PickedCount = 4                                                                                      -> Sprite.Destroy
    [/code:2yk7dpqv]
    
    capx here: [url]https://dl.dropboxusercontent.com/u/66037205/DestroyWhenSurrounded_B.capx[/url]
  • Thanks for your quick reply!

    What I am needing is for "Surrounded" to be true if there is an object on all four sides (and result in the object being destroyed). By using or, I think that would make the condition true if there is an object on any of the four sides.

    It seems like my logic should work, but it does not. It may be due to the way overlap at offset is tested?

    It could be that there is a completely different way to test for this condition that I am missing.

    Basically I need to answer the question "Am I blocked in all four directions... surrounded on all four sides by something".

  • I am trying to destroy an object when it is surrounded on four sides. I tried an event with four conditions, when object is overlapping at offset -- for four different directions.

    I am probably not understanding something about how this event should work.

    Event I have is:

    sprite is overlapping at offset(32, 0)
    sprite is overlapping at offset(0, 32)
    sprite is overlapping at offset(-32, 0)
    sprite is overlapping at offset(0, -32)     
          action:  sprite destroy
    [/code:4859lp0h]
       
    
    capx is here:  [url]https://dl.dropboxusercontent.com/u/66037205/DestroyWhenSurrounded.capx[/url]
MudbuG's avatar

MudbuG

Early Adopter

Member since 11 Jul, 2013

None one is following MudbuG yet!

Trophy Case

  • 11-Year Club
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

14/44
How to earn trophies