AllanR's Forum Posts

  • Isaske

    I definitely like the way body wiggles in your original version. it is very bug like! and feels more alive. I also like the tapered body.

    I would stick with the bullet behavior... the advantage of using dt is that you get the same game play on all devices. If someone has a high-end monitor with a really high fps rate, your worm would zoom around way too fast without dt. (or on mobile with low fps it will go way too slow)

  • Isaske

    I took another look to see how I would do option 1 above... and it was easier than I first thought. I added a BodyWidth instance variable to the body segment so that we can compare the distance a segment is from the previous one, and if the distance is greater than the BodyWidth variable then we move up the array until we find a position that wont leave a gap.

    so download the file from the link above and give it a try! I couldn't make show a gap in the worm.

    another change I made was to move each body segment to the bottom as they were being created, so that the head is on top and the tail is on the bottom. I think it works and looks better that way. If you don't like it, just remove the "Move to bottom of layer" action in event 5.

    good luck with your game!

  • Shouwrex

    export for desktop NW.js

  • mammoth

    it will run every tick. if you only want it to run once, put it under an "On start of layout" event,

    or put it in a function and call the function when you need it, like "On start of layout", just remember that if you call the function every tick, it will still spawn continuously...

  • sho07860

    I would put them in an array. You can save and retrieve the whole array from local storage, and you can sort the array...

    I made a quick sample to show you how it works.

    https://www.rieperts.com/games/forum/leaderlist.capx

    sorting the array gets a little tricky, because you can only sort the first element on a axis, so we have to reserve the first element for sorting purposes (element 0), and store all the data in elements 1,2,3... and then copy the column we want to sort by into element 0 before we can do the sort. To get the array in descending order (so high score is at the top) we reverse the array after sorting it... (when sorting by score. Name and car are sorted ascending in my example).

  • Try Construct 3

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

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

    most likely the touch is making contact with both sprites, so both are picked. What I do in cases like this (since there is no way to know which sprite the user intended to touch) is to add a subevent to Pick the Top instance before you call your function. It doesn't really matter which Field is the top one, you just want to make sure only one is selected.

    I guess the other option would be to check the PickedCount and if it is more than one, tell the user be more careful when choosing a move...

  • Isaske

    first of all, I think it works really well. that worm is pretty creepy! :)

    I had major trouble getting it to break apart, and it corrects itself so fast that I don't think it is much of a problem.

    There are only two things you can do to minimize the issue:

    1) each time you update the position of a body segment, check to see if it is more than the actual segment width from the previous segment (or head) - which is 33 pixels (but then shrinks as the segments get smaller). And if it is too far away, then calculate a position that wont leave a gap.

    2) or, make the segments twice as wide so there is more overlap. that way, if there is a glitch in frame rate, the worm can stretch out without showing a gap.

    I made a quick test to see what that would look like (you will obviously have to make your artwork look nicer). I also slightly changed the way the array works so you don't have to do so much overhead combining and then breaking apart the values you want to store (I made the array 2 dimensional instead of 1). I also pre-calculate the max array length. Anything you can do to reduce the work-load each tick makes things run smoother (and reduces the chance that you might drop a frame or two and get a gap).

    you can see my version here: https://www.rieperts.com/games/forum/worms.capx

  • dop2000 Sangeeth777

    Nice job! I was tempted to give it a try yesterday too. Then I saw your's and that inspired me to add a few enhancements to it...

    like explosions, and a HUD. Left click to shoot, right click locks the HUD so it stops following the mouse. I skewed the ground in photoshop, and made the parts for the HUD there too. (I borrowed the explosions from the Space shooter tutorial)

    obviously, this is totally fake 3D, so you can't change camera angles like in the GIF above, but it still looks pretty good and would make a fun game. You can rotate the ground layers with the arrow keys, but that messes up the targeting of the bullets...

    https://www.rieperts.com/games/forum/HelicopterGunHUD.capx

  • dop2000

    nicely done! :)

  • bangoo

    you probably have a problem with quotes... I just tried what you said you did and it worked fine for me...

    you might want to think about using different array values to hold just one piece of information:

    array at (0,0) = name

    array at (0,1) = wins

    array at (0,2) = points

    then to add more people to the array, just change the first index to 1, 2, 3, 4...

  • dop2000 lol, sounded like a fun thing to try - going to see how you approached it now...

    edit: you did it in a lot less events! although I was also showing feed back and was setting it up to be able to tell the player if they had any valid moves or not.

  • legofreak689

    here is a quick sample to look at...

    each circle knows what row and column it is in, so we can test if it is a valid move from the last one.

    It only tests for valid move if the mouse is over an open circle - so you can't move to a filled circle.

    https://www.rieperts.com/games/forum/circlegame.capx

  • nagyv

    it is not a bug, but the object count doesn't get updated until after the next top level event after the object gets created.

    so, all your code executes just fine, you just can't depend on the .count being accurate at the time you are displaying it...

    in event 6, call the function first, add a "Wait 0 seconds" and then log the Pawns.count

    and you should get the correct result.

    (The "Wait 0 seconds" forces the eventsheet to execute the actions after it at the end of the current tick, and by then the count has been updated internally.

  • You could add an instance variable to the object (or family) and keep track of that yourself.

  • Ninjadoodle

    the arrow that drops straight down on you is just cruel! after many tries, I completed it twice with a score of 40 and 42.

    would be interesting to know how many times you died...

    oh, sound effects still played after turning them off (it was breaking my heart to hear the poor guy die in pain time after time).