nexus87's Forum Posts

  • 13 posts
  • Ah ok. That makes things a bit clearer., thank you

  • Thanks lionz! That's pretty much what I did

    So I created a couple of variables: curPermTablePos to save what index of the permutation table to look at, gameLength to save how many random items I wanted to get.

    Then I created a permuation table with 7 (gameLength) values betweeon 0 and 50. I found if I left the offset at 0 I would only get values 0-7 in my permutation table, so I changed it to be

    int(random(qCount-gameLength))

    where qCount is the total number of questions there are, so this evaluates to

    int(random(50-7))

    so I get a random offset of a whole number between 0 and 43.

    When I get a question I call

    which uses the curPermTablePos variable to load a random entry from my list of questions.

    Once I have loaded the question I just increment curPermTablePos by 1 to get the next question.

  • I'm making a trivia game. I have a JSON file with 300 questions and answers but I only want individual 'games' to consist of 7 questions.

    Currently I can iterate throught the first 7 items with something like

    JSON.Get("Questions." & vNum-1 & "." & 0)

    where the array key is "Questions", vNum is a parameter passed in and index 0 holds the question. So, for example, on the start of the layout vNum = 1 so this retrieves

    Questions.0.0

    which is the question of the first item in JSON. vNum then is incremented by 1 so the next run gets

    Questions.1.0.

    How can I get 7 random items from this list of 300 without repeating any? I know I could try

    JSON.Get("Questions." & random(JSON.ArraySize("Questions")) & "." & 0)

    but I can't be sure that this won't return duplicates.

    Tagged:

  • Weird. I'm not comfortable trying to promote the game if I can't reliably play it myself

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • That's really weird. It is blank for me in Firefox and Chrome, private browsing and incognito. In Edge only half of the sounds work. I've even tried it on a different PC and it's still blank.

    I wonder if it's something to do with browser addons? Maybe an adblocker or something? If that's the case is there any way around it?

    [Update] OK, I found that if I disable uBlock Origin it works. Is there anything I can do about this in my game to make sure it works for uBlock users? Note: this only seems to affect the Scirra arcade link, the link on my personal site does not work properly with or without uBlock.

  • When I run my game preview in a browser it works perfectly fine, but when I export it and upload it it stops working! I get a blank screen and can only hear audio. You can try it here: http://robert-kent.com/trainerwreck/

    On Firefox I get this error:

    [quote:18l32mhk]TypeError: Value being assigned to AudioParam.value is not a finite floating-point value.

    On Chrome I get:

    [quote:18l32mhk]Uncaught TypeError: Failed to set the 'value' property on 'AudioParam': The provided float value is non-finite.

    at K.play (c2runtime.js:320)

    at y.decodeAudioData.a.pj (c2runtime.js:315)

    Is this a problem with the audio files I'm using? Do I need to re-import them or something? I'm really confused because this works fine when I preview it on my PC.

    The capx is here: https://drive.google.com/open?id=0Bw66e ... 0hJNnJ5Rzg

    What's also weird is when I upload it to the scirra arcade it is totally fine the first time you play but if you refresh the page it stops working: https://www.scirra.com/arcade/action-ga ... reck-13782

    Maybe an export option I'm doing wrong?

  • I'll give it a try

  • I have made a "pop the bubbles game" where the player has to tap on balloons that float up from the bottom of the screen. I have created a powerup that temporarily slows the balloons down but it doesn't stack properly.

    The way it works is:

    • There is a variable BalloonSpeed that controls the velocity of the balloons
    • When a player touches a 'slow time' powerup
      • The current BalloonSpeed value is copied to a tmpBalloonSpeed variable
      • The BalloonSpeed value is reduced
      • An external sprite objPowerupTimer with a Timer behavior starts a new 5 second timer tagged 'slowtime'
    • When the 'slowtime' timer expires the tmpBalloonSpeed value is copied back to BalloonSpeed to restore the original speed.

    This works as intended if the player hits a single 'slowtime' powerup but my problem is if the player hits another one before the speed resets the original speed is never restored. I have debugged the layout and the timer itself does reset but it is as if the On Timer event doesn't fire afterward.

  • That makes sense. I'll need to look into arrays but I'm guessing I could use an array to store things like level1_speed, level1_rate, level2_speed, level2_rate, e.t.c. instead of having separate variables for each.

  • I've created a very simple balloon popping game like the first example in the Level Zero eBook. Basically I randomly spawn balloons that head to the top of the screen and the player gets points for tapping on them.

    At the moment I am increasing the speed and rate of the balloons every X seconds. What's the best way to split this up into different levels so that each is more difficult? Duplicate the layout and event sheet for each level? Make multiple layouts with one event sheet? If there's only one event sheet how do I keep track of what the current level is? Do layouts have variables?

  • I'm on iOS 9.2.1 and if I browse to my game in safari audio works fine but if I pin it to the home screen then launch it there's no audio at all. I can even switch right back to safari and audio continues to work.

  • iPads and a Windows touchscreen. After a bit of experimenting I've noticed that Construct 2 appears to be using localforage for saving data which I'm already using in other areas so that's really good.

  • I'm working on a project with the following requirements:

    • Players should be asked to enter their name and either an email address or contact number
    • Player data should be stored offline locally then the game starts
    • When the game is complete the player's score should be stored with their other data and another player allowed to start
    • All the locally stored offline data should be uploaded later

    At the moment I have an index.html for showing the first form and saving the data, then I was planning to link to the game on a game.html page and finally I have an admin.html page for showing offline data and allowing an upload.

    Can I use Construct 2 to update the already saved-player data with their score when the game ends? Would it be better to take the name and contact details after the game rather than before? Should I do this data storage in Construct 2 or around it in separate files?

    There is no way around the offline requirement I'm afraid.

  • 13 posts