oceldot's Forum Posts

  • I suspect maybe Google Play Game Services may be the best solution, but as far as I can tell this is currently not working for Crosswalk. Starting to think I have to drop this feature all together. I have to admit it's a bit disappointing that something like this should be so hard to add.

  • I'm about to add a very simple (hopefully) ranking system and I wanted to get some ideas on how to do it. I've never added anything like this (or multiplayer related functionality at all, for that matter) so I'm not really sure how to get started.

    My game is really a single player game and there will be no interaction between players. All I'm planning on adding is a ranking system that read out "#X". Also worth mentioning is that it is a game for Android.

    The game uses several variables that hopefully can be used to calculate this. The point of the game is to finish it as quickly as possible with as few restarts and jumps as possible. So I'm thinking that the number Time+Restarts+Jumps=Score (lower is better) can be used to create the list.

    The problem is how to implement it. Can I create this using the multiplayer functionality in Construct? Do I need to use clay or similar? I also don't want the players to have to create a user or similar if possible, maybe just assigning a unique ID at the start of the game is enough.

    Sorry about the messy post, I'm just thinking out loud. Please ask if something is not clear. Any input would be appreciated.

  • Sweet! The looping makes it a lot easier.

    Thanks a lot.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Just do the same *10 /10 rounding on the total.

    I am not a smart man. Not sure exactly how to write it. Currently I have played for 61.099999.. seconds, and I want to display this as 61.0 s or 61.1 s (or even better 1.00 s/1.01 s, but from what I have tried this seems like an even bigger job.

    Originally - will display "61.0999999..."

    float(WebStorage.LocalValue("Time_Level1"))+float(WebStorage.LocalValue("Time_Level2")) +float(WebStorage.LocalValue("Time_Level3"))+float(WebStorage.LocalValue("Time_Level4"))+float(WebStorage.LocalValue("Time_Level5"))+float(WebStorage.LocalValue("Time_Level6"))+float(WebStorage.LocalValue("Time_Level7"))+float(WebStorage.LocalValue("Time_Level8"))+float(WebStorage.LocalValue("Time_Level9"))+float(WebStorage.LocalValue("Time_Level10"))+float(WebStorage.LocalValue("Time_Level11"))+float(WebStorage.LocalValue("Time_Level12"))+float(WebStorage.LocalValue("Time_Level13"))+float(WebStorage.LocalValue("Time_Level14"))+float(WebStorage.LocalValue("Time_Level15")) & " s"

    This will give me "6 s"

    round((float(WebStorage.LocalValue("Time_Level1"))+float(WebStorage.LocalValue("Time_Level2")) +float(WebStorage.LocalValue("Time_Level3"))+float(WebStorage.LocalValue("Time_Level4"))+float(WebStorage.LocalValue("Time_Level5"))+float(WebStorage.LocalValue("Time_Level6"))+float(WebStorage.LocalValue("Time_Level7"))+float(WebStorage.LocalValue("Time_Level8"))+float(WebStorage.LocalValue("Time_Level9"))+float(WebStorage.LocalValue("Time_Level10"))+float(WebStorage.LocalValue("Time_Level11"))+float(WebStorage.LocalValue("Time_Level12"))+float(WebStorage.LocalValue("Time_Level13"))+float(WebStorage.LocalValue("Time_Level14"))+float(WebStorage.LocalValue("Time_Level15"))*10)/10) & " s"

    And this will display "6.1099999..."

    ((float(WebStorage.LocalValue("Time_Level1"))+float(WebStorage.LocalValue("Time_Level2")) +float(WebStorage.LocalValue("Time_Level3"))+float(WebStorage.LocalValue("Time_Level4"))+float(WebStorage.LocalValue("Time_Level5"))+float(WebStorage.LocalValue("Time_Level6"))+float(WebStorage.LocalValue("Time_Level7"))+float(WebStorage.LocalValue("Time_Level8"))+float(WebStorage.LocalValue("Time_Level9"))+float(WebStorage.LocalValue("Time_Level10"))+float(WebStorage.LocalValue("Time_Level11"))+float(WebStorage.LocalValue("Time_Level12"))+float(WebStorage.LocalValue("Time_Level13"))+float(WebStorage.LocalValue("Time_Level14"))+float(WebStorage.LocalValue("Time_Level15"))*10)/10) & " s"

  • I feel like I have been bothering you a lot lately, but I swear my game is almost finished now

    Today I wanted to share about a seemingly random thing I've seen that is starting to annoy me.

    I have a counter for each of my levels (Every 0.1 seconds -> Add 0.1 to Timer_X). This works like a charm.

    At the end of each level I add the time to a webstorage local key (Set local key "Time_LevelX" to round(Timer_LevelX*10)/10). This will round down and save only 1 decimal to the key.

    However, in an overview page, I'm displaying the total time for each level added up:

    Set text to float(WebStorage.LocalValue("Time_Level1"))+float(WebStorage.LocalValue("Time_Level2")) +float(WebStorage.LocalValue("Time_Level3"))+++ and so on.

    Most of the time this looks good, but once in a blue moon it will display a long row of decimals, even if the keys separately only has 1 decimal.

    Any way I can improve my math?

    [attachment=0:idu2zwtj][/attachment:idu2zwtj]

  • Ok, if you are sure..

    Although it is related for one of the conditions is to check the local key level1 and if that local key is changed, but not changed back..

    But I'm just responding to what I see in your events, maybe you are changing it back to 0..

    Ah, you sir, are a genius. Not sure why I couldn't see that before.. Of course it won't update "Time_Level1" as "Level1" always will be 3 after first completing the level. With some black magic and sorcery I was able to add another event that enabled me to update the value each playthrough.

    Thanks

  • well you are setting localkey level1 to 3 and you are not resetting it I guess, so those webstorage commands are never executed again..

    Hm, the local key "Level1" is not related here. This is controlling something else and is behaving as expected.

  • Could you please provide a capx or show your events so we can see how you have set this up?

    If you are saving the value the correct way, it should work..

    Sure, sorry about that. It's a bit messy, hope you'll understand.

    I'm using quite a few other keys, and they are working fine. However, this "Time_Level1" seems to be set only the first time I complete the level for some reason. I was hoping to update it every time I run the level.

    [attachment=1:1tolgfdh][/attachment:1tolgfdh]

    And here is a part of my level selection layout, where I display the value (which is working fine it seems).

    [attachment=0:1tolgfdh][/attachment:1tolgfdh]

    I really don't see what the problem is.

  • I have also tried to remove the key on start of layout, and then something like:

    Local key "Time_LevelX" not exists -> Set local key "Time_LevelX" to Timer_LevelX (the global variable)

    However, this way it is just deleted when I start the layout and never created again...

  • Hi,

    I struggle with setting the value of a key. I want it to overwrite the existing value every time I play a level, so that you at all times can see the latest score on each level.

    What I have done so far is to create a global variable which I use as a timer (one for each level), adding 1 to this variable every second.

    Then, at the end of the level, I do something like: Set local key "Time_LevelX" to Timer_LevelX

    Then I display this in a level selection layout like this: Set text to WebStorage.LocalValue("Time_LevelX")

    The problem is that is seems to only be storing the key the first time I finish the level. If I try again, it doesn't get updated, and I'm stuck with same time every time.

    Could someone please explain why is it not updating the value?

  • From the "Performance Tips" section of the manual:

    Changing Text objects every tick

    Change the size or text of a Text object every tick - even just for an animation or transition - will likely produce poor performance, especially on mobile devices. The problem is even worse if the text object is large. Text rendering is very fast as long as the object is not changing, but upon changing the object must do a relatively expensive redraw of the text and replacement of the cached texture. Try to use small Text objects that do not change regularly. If you must change text regularly, consider using a Sprite Font instead, which is fast even when it changes every tick.

    I see. Thanks.

  • I'm making a game where I'm using similar functionality as seen below. Problem is that is shows a major drop in fps right at the start of the layout (tested on Nexus 5).

    It's really annoying and I was hoping I could find a way to improve or it. Does anyone have any idea of to make it run smoother?

    [attachment=1:256wf4ik][/attachment:256wf4ik]

    [attachment=0:256wf4ik][/attachment:256wf4ik]

  • Am I the only one who is experiencing an issue when using the On Left/Right button clicked event? As far as I can see it happens when I use it with addition of system variables (when left mouse button clicked -> add 1 to system variable x).

    If I set this up to use the left button for adding 1, it will add 2 when I click with the left button. With this setup, I can click right button to add 1 (strange, as I haven't even set up right button to do anything). And visa versa, if I change to add 1 when clicking the right button, this will add 2, and left button will now add 1.

    Does that make any sense at all?

  • Is this happening when using XDK version 1199? I just downloaded that today and noticed some changes, and I believe I got a similar error message. I was able to build using Android Legacy. However, it seemed I have some issues using this method (lagging, sound cutting off etc). Only just started using it, so there may be more issues. If someone could help figure out how to set things up to be able to use the new Crosswalk for Android Cordova build method, that would be awesome.

    Edit: I also notice I'm not able to use browser close action to exit the game.

  • I'm asking out of curiousity here, as I haven't been able to find anything quite as I have in mind. It might not be possible, but I wonder if it's somehow possible to create a game/app using C2 which allows players/users to connect and plot their location using geolocation and add an image taken at that location so that other players/users can see them? Can the Multiplayer object allow this in some way, sending images back and forth rather than sending for example information about your ingame avatar?