Juryiel's Forum Posts

  • What problem specifically are you having with high scores? You should easily be able to use the websotrage object to store a delimited string of high scores.

    So if you have 10 high scores, load them into an array with size 11, and set the 11th value to the current score, then sort them, and save the first 10 values of the array as your new high scores.

    You can load the scores from the webstorage object, and parse them by using float(tokenat(HighScoresString,N,":")) where HighScoresString is your delimited string of high scores, N is the Nth score, and : is your delimiter.

  • You should try it because that's how you learn. Why don't you make an attempt, upload it, and when I get home in 10 hours I will look at it and fix it if it's not working.

  • This means you will need to identify the different groups of overlapping objects within the "Check Overlap" function. A given group can be defined whenever you reach these two conditions:

    1. For a given Sprite, there are no more overlapping Reds, (or Sprite2 and Greens) and recursion has reached the deepest level

    AND

    2. The number of overlapping sprites found is greater than 2

    So whenever these conditions are true you can store an X and a Y value of where you want the new sprite to be created, then loop through all those values after they have all been created and create a sprite for each.

    Why don't you give it a shot, it should be obvious where the two conditions I mentioned are met if you look at my capx. If you can't figure it out I'll edit the example, but it will be a long while before I have time to do that.

  • Sorry still confused, you want to first destroy 3 sprites, then create a single other sprite in their place?

  • You're not being very clear about what you want. Think of all the situations all balls on a layout may find themselves in, and describe what you want to happen.

    And specifically, if my example isn't doing waht you want, why? What did you need to be different?

  • Well, collision isn't made for 3 objects at a time, so it's not easy this way.

    I would start by making an "evalSystemState" function, that would eval the system every 0.1s or so. It would examine every ball, one after the other, checking how many other balls were in its vicinity and saving this in a variable on the balls. Once this is done, you would just have to destroy every ball that have 2 or more in this variable.

    The problem with that is that if Ball B is in the vicinity of Ball A, and Ball C is in the vicinity of Ball B but NOT in the vicinity of Ball A, then you won't destroy all of the balls when in fact you should (if I understood correctly what the OP wanted).

    On the other hand, if the only condition that destroys the balls is when all 3 are touching each other, the problem becomes much simpler, as you say.

    As far as doing the detection of one object with multiple objects of the same type, the trick I learned in C1 was to put object A in family A, then pick a given instance of object A, and check it against all instances of family A (except itself). Seems like it works in C2 as well, though I'm not sure if there's a better method.

  • You need to use recursion to solve this. Here is a capx

    https://dl.dropboxusercontent.com/u/30864403/overlap.capx

    Probably not the most efficient way, but this is the idea.

    In this example, you can drag the objects around until they overlap. The opacity of the objects will change if 3 or more are touching in any sort of formation (e.g. they don't all have to touch each other, just a series of 3 touching).

    Instead of destroying the objects, I make their opacity 50%, for demonstration purposes. You can destroy them if you just change that action yourself.

    Disclaimer: There may be bugs :P

  • What do you mean? I used x86 or whatever. I just really am trying to figure out how to export it for Google Play on the Samsung Galaxy

    I mean that your phone (and most phones) has an ARM processor so you should export for ARM.

  • sachos345 I exported it with x86.

    Isn't your device ARM based?

  • The device is not old, it has cutting edge mobile GPU. It's a Tegra 4. It has a fill rate of 2.68 Gpix/s (whatever that means, it's probably good :P)

    Also it can run 2d games like Reaper at 60fps with many more sprites and effects and such.

    Autorunner is just an utterly basic game, not being able to run that game at 60fps means either that C2 is not optimized, whatever graphics libraries are used are not optimized, or Autorunner is not made in C2 in an optimized way. You can't say that it's because the GPU is old because it's possibly one of the best mobile GPUs in existence and as a gamer who has many, many android games, so far C2 Autorunner is the only game that has given me fps noticeably below 60.

    There is clearly a problem on someone's end, and it's not the GPU.

    Edit:

    Doing some probably incorrect math here but at 2.68 Gpix per sec / (2560 x 1600) resolution I can redraw the whole screen 655 times per second if fillrate means how quickly it can draw pixels. This means that I would have to redraw the screen 11 times every frame to drop below 60fps if this were just a fillrate issue. This probably isn't how it works, but however it works, I would imagine with that fillrate it would take a lot to drop to 30fps

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I agree that just making an engine native wouldn't necessarily improve things and I'm not saying that's what the problem is. However, if a native engine was coded to handle graphics better than whatever C2 or WebGL implementations in browsers are doing it could make a difference. Clearly something is going on right? I'm not the expert here really, so how do you reconcile these facts?:

    1. Device has good, modern GPU, which supports WebGL

    2. Device can push 60fps in complicated 3d games easily at high resolution

    3. Device can't run Autorunner beyond 30fps at high resolution

    I think the answer to that will solve the performance problem I'm having, whatever that answer is.

  • I do think there is some problem with C2 (or WebGL?, somewhere anyway) in terms of performance. I tried running Autorunner (included in C2) on my Asus Transformer Prime TF701, which has a Tegra 4 chip. Needless to say, I can only get 30 fps on it unless I change the High DPI setting to off. Clearly this shouldn't be the case, I can drive much more demanding games than Autorunner on this device (and I didn't make Autorunner, so I couldn't have done something wrong). It does run smooth on lower resolutions though. I contacted Scirra bout this so I'm curious to see what the response will be, but for now I'm running at low resolutions.

    I get similar effect when I make my browser window large on an older (5 year old) desktop that was top of the line at the time of purchase (but obviously outdated now)

  • Can't you just check the string values?

    Have a correct string, CString="R:G:B:Y", and each wire has some instance variable Var1 of either "R", "G", "B", or "Y".

    Test Var1 against tokenat(CString, N, ":"), where N is the (N-1)th wire being cut so if he's cutting the 3rd wire, N is 2.

    Haven't actually tested any of this but it seems like it should work.

  • I would like to be able to check if a user is logged in. Can we get a condition for this? What I mean is, I want to check if a user is logged in, and if not, show him a button "Submit Score Online". That way, when the popup happens asking them to sign up to clay.io, they'll expect it and be more likely to do it. If they are already logged in I can then just have the score posted automatically without clicking the button every time. This gives them the option of playing without being bothered with signups, but can choose to do so if they want and then have scores automatically submitted conveniently.

    Also, I see this in your docs:

    ill in the forms

    Name will show at the top of the leaderboard

    Type, if set to incrementing gets a cumulative score per person (typically you won't use this)

    Unique Identifier is optional, but acts as an easy to remember ID for the leaderboard

    However the 'incrementing' option doesn't seem to exist

    In addition, when I post a score I want to specify the player name. It seems the Post Leaderboard Score action allows me to do this, but only if the user is already logged in. If not, the player specifies the name. How can I control what name shows up on the leaderboard if a player hasn't yet logged in when the Post to leaderboard action is called?

  • Is it possible to sort an array in C2 by values in another array (of the same size) without writing a custom sort function?

    Usually languages that make this functionality available do it by returning a vector of the sort index of array A, and allowing you to sort array B by a vector of indices. I'm not seeing anything like this in C2 but I thought I'd ask if there was some simple way I was overlooking without having to write my own sort function.