AllanR's Recent Forum Activity

  • it doesn't like the fact that the address is http, not https

    you may be able to click the little cloud in the top right corner to allow it to read insecure data, but I am not sure if that will work.

  • there are a few ways to do it, you can set angle of motion to "angle(start.x, start.y, player.x, player.y)"

    or you can set the bullet object's angle using "Set angle towards position" and give it player.x and player.y

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If you add the Browser Object you can run javascript to return the current time on the device (computer/phone/tablet)

    Browser.ExecJS("const CurDate = new Date(); CurDate.getHours();")

    the above will return the current hour - from 0 to 23.

    if you want to prevent people from changing the time on their device to cheat, then you have to request the current time from a time server using AJAX, but if someone wants to cheat, they can get around that too.

  • if anyone stumbles across this in the future, I ended up filing a bug report:

    https://github.com/Scirra/Construct-3-bugs/issues/4255

    Because of worker mode, there is no easy way for this to be fixed. The solution Ashley suggested was to dispatch the input event after updating the value in javascript.

    const elem = document.getElementById('input1');
    elem.value='test 1 2 3';
    elem.dispatchEvent(new Event("input"));

    This works great, and has the added benefit of causing the "On Text Changed" trigger to fire.

  • That is correct...

    I just checked my sample with debug mode, and saw that the angle gets set to 0 when the speed is set to zero.

    I thought that might be a bug, but then I read up on the Bullet behaviour in the documentation, and it says that is how it is supposed to work. So, your solution of storing the angle is the best option.

  • if the bullets change direction, then you have a picking issue somewhere in your code. When you think you are setting a new bullet's angle, you are accidentally setting all of them.

  • to check the runtime version, go to Layout 1, click on the layout. Look at the properties bar on the left. expand that,and in the middle you will see Advanced. Click the triangle and the runtime setting will be at the top of that section.

  • since the player has time to think about their moves, and the enemy does as well, you will probably have to set a limit to how far the bullets can move on each turn. Otherwise the player could just shoot, and then wait before completing their turn - not giving the other player/enemy a chance to move out of the way.

    I took a quick crack at it to see how I might approach it...

    a turn give each side a chance to do 3 "moves" - which could be moving the player or shooting.

    (use arrow keys to move, space bar to shoot). The enemy doesn't choose its own moves, so you have to play as both players.

    http://www.rieperts.com/games/forum/TurnShoot.c3p

  • I just checked and it is available for me... the orbit behaviour is only available with the C3 runtime, so if your project is using the C2 runtime then that would explain why you can't find it.

  • for arrays, x is the row (or width) and y is the column (or height of each row).

    so the answer to the second question is yes, increase the array width from 26 to 31.

    then you need to decide exactly what data you want to store for each level. If it will never be more than 3 items, then you could just use three columns and then it is up to you to decide what item is in each column for each level. Or create 8 columns where each column is always the same item. It wont make a difference, so which ever way is easier for you will work fine. And you could add additional columns for any other data - best time, date, how many times the player has played that level, etc...

    row 0 in the array is reserved for the other global variables that you wanted stored in local storage

    To read data out of the array, it will always be Array.At(currentLevel,itemColumn)

    so if Gold Stars is always in column 0, apples in column 1, oranges in column 2, you would set or read data from the array like this:

    Gold Stars collected in level 2 = Array.At(2,0)

    oranges collected in level 3 = Array.At(3,2)

  • You need to save the "gotStuff" for each level. The easiest way to do that is with an Array.

    I changed it so that all the local storage data is saved in one array. That means you only have to check for that one item.

    since arrays start with row 0, and your levels are numbered 1 to 25, I stuff the other global variables in the first row (row 0). Then each row after that stores data for each level - which right now is just the gotStuff indicator. You could add more data in the future - fastest time, other stuff collected, how many stars (1, 2 or 3), etc...

    If you add more levels you will need to increase the size of the array. It needs to be one more than the number of levels since the first row is used for the global variables.

    https://www.rieperts.com/games/forum/TooHard2.c3p

  • haha... I haven't looked at your example dop, but I just finished mine...

    https://www.rieperts.com/games/forum/Stacky.c3p

    I used Platform and solid for both the bird and the body. Seems to work pretty well.

AllanR's avatar

AllanR

Member since 21 Nov, 2013

Twitter
AllanR has 23 followers

Trophy Case

  • 10-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Popular Game One of your games has over 1,000 players
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

19/44
How to earn trophies