AllanR's Forum Posts

  • It has been a few months since I last used the multiplayer template - but it worked fine.

    It is very easy to run into trouble if you are not clear on how it works. If your peer position is getting reset, then you are probably trying to move it manually, rather than having the host move it (then on sync, the host moves it back to where it thinks it should be).

    When you follow the rules, it works well, but if you try to do things like you would in a single player game you will break it very quickly!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Phoenixbowman

    the event sheet automatically loops - every tick (60 times per second), so normally you don't need to set up another loop, unless you want something else to happen multiple times per tick. So, generally, things will always keep happening until a condition in the event becomes false... (without using Repeat or While)

    It took my son a while to wrap his head around that when he was learning C2. The other thing he kept doing incorrectly was using Wait (thinking it would pause the event sheet). I see a lot of other people get confused with that too.

  • PixelPower

    I just quickly tried your game - one of the problems PrinceofMars had was because the two round buttons (return to menu and restart level) both still work even when they are not visible.

    You should either move them off the screen, or check if they are visible , or put them in a group and disable the group when they are not visible.

  • TRMG

    I made an example a year or two ago for someone asking a similar question. I ended up making an angry birds type game.

    There was a thread last month where someone else was playing with it:

    https://www.scirra.com/forum/viewtopic.php?t=182292&p=1070325#p1070325

    or see my original capx files:

    http://www.rieperts.com/games/forum/angry_birds.capx

    or a better version (but requires ROJOhounds chipmunk physics plugin)

    http://www.rieperts.com/games/forum/angry_birds_chipmunk.capx

    The chipmunk version leaves a trail of dots after each shot - so you know where you aimed previous times. And the chipmunk version preforms better on mobile.

  • I tried it on my desktop too. In Chrome, I get the jank as you reported. Works fine on Edge. With firefox, there is no jank, but the first time there is almost no sound at all.

  • Gearworkdragon

    I have been working on a database application in C2 and ran into the same problem. There is no "easy" solution, but there are a few ways to get close to what you want. First, you could try using the Dictionary object. It allows you to define names, then get the value associated with that name in an expression:

    so, you would have a Dictionary with: "bob":1 "kitty":2 "joe":3 "mary":4... "HP":1 "power":2 "speed":3...

    then, when you want to lookup bob's HP you would use: stat.at(Dictionary.Get("bob"), Dictionary.Get("HP"))

    Since I am working with a MySQL database, I have the calls to the database return the field names as well as the data, then use TokenAt to find what I am looking for, because the query could return fields in different positions depending on what I ask for - so I can't assume they will always be in the same place.

    EDIT: and of course, you can create a general purpose Function called LookupStat (or whatever) and pass in the name, and the stat you want.

    then you could have: value = Function.Call("LookupStat", "bob", "HP")

    in the function you would have Function.Set Return Value to stat.at(Dictionary.Get(Function.Param(0)), Dictionary.Get(Function.Param(1)))

  • Well, it looks to me that you are putting a tile over top of an old one - so it isn't deleted, but replaced...

    the tiles are square, but your grid lines are diagonal.

  • glerikud

    From looking at your picture above, I can see that there are no cases of a collision box on both sides of a grid line.

    In the first (top left square) you have 4 grid lines and four collision boxes. In your second example (top right) you have two squares joined together - so you have 7 grid lines and 7 collision boxes. The problem is that the grid line that connects the two squares together can only have one collision box...

    In the bottom part of the picture, there is only one complete square (the left most). All the other squares are missing one or more collision boxes where they are joined to another square. But every grid line does seem to have a collision box... (there are 40 grid lines, and 40 collision boxes)

  • Freuvim

    you probably have created an infinite loop... the while loop is not ever ending because the condition is not being detected.

  • That is nice to know... thanks for the info!

  • Lasmelan

    in the Join Room code in the signalling group you can limit the number of peers by putting a value in the last field - max peers.

    But, I guess if you have max peers set at 5, and a group of 4 decide to play, then you would have to have the host automatically kick out a 5th peer...

  • sadism

    create a php file called something like: servertime.php

    with contents:

    <?php

    header('Access-Control-Allow-Origin: *');

    $dt = new DateTime();

    echo $dt->format('Y-m-d H:i:s');

    ?>

    then use an ajax call from within C2 that calls that php file. In the On Complete event, the date and time will be in the AJAX.LastData field.

  • I don't believe it is possible to access the points of the collision box - but what I have done in similar circumstances is use an invisible square sprite, and position in over an image point. Then you can calculate the coordinates of that sprite to see if it is within the target area.

  • Travlanders

    C2 can work very well on mobile.

    If you use a TextBox field, then the mobile will automatically call up an on screen keyboard.

    If you use Buttons, touch works as expected.

    and you can manually build any interface you can imagine.

    you can also access many mobile specific features - like the camera, microphone, tilt sensors...

    if you want to try a project I use to test things out on my phone, use your phone's browser to go to: http://www.rieperts.com/games/buttons

    you can pinch to zoom, and pan around when zoomed in. You can drag the button panel around. Some of the buttons are toggle buttons, and some are push buttons... some buttons to more than one thing, and it does change occasionally when I am testing something new.

    you can also try http://www.rieperts.com/games/birds

    which is an angry bird clone I did as a test too.

    Mobile C2 games/apps that you host yourself run better if you have the user save the game to their Home Screen - then you don't get the browser menus at the top and bottom of the screen getting in the way.

    You can also export your game to various mobile wrappers and upload them to app stores.

  • Artpunk there was a post a couple days ago about someone having fps issues on a windows phone. Putting the phone to sleep and then coming back seemed to make a big difference...

    obviously, there is a major bug there that Microsoft needs to fix.