AllanR's Forum Posts

  • NAF

    that is an awesome game!!! very simple concept. but very well done - and way too addictive! :)

    I made it to level 13 once... and level 12 a couple other times.

    at the start of one level, a bad guy spawned right on top of me - and ended the game before the level started.

    and boxes routinely spawned on top of the player... (I am sure you knew that)

    would be nice to be able to start at a higher level.

    after about level 8, the bad guys are very difficult to trap.. (the time I beat level 12 took forever to actually trap all of them after I had confined them to an area where they couldn't get me) but I am not really sure what you can do about that...

    any way - with a little more polish, you will have a fantastic game! Congrats!

  • Either you aren't touching the sprites (because of collision polygons, or some other reason), or the event is not running (because it is in a group that is disabled, or there is another condition that isn't being met, or the events are on an eventsheet that isn't included, or you accidentally changed the eventsheet for that layout).

    What I do in situations like this is break things down to the simplest terms. make a new "on tap" event and have the sprite flash, or change opacity or something obvious. if that doesn't happen, then try making a new sprite and test with that...

    the fact that the old version works tells me you are overlooking something that will probably make you do a face palm when you find it! :)

  • andreluizgollo

    I noticed my sample was slightly off - because the textwidth was too long. turns out I had a silly bug. The font character widths weren't actually getting loaded because of a typo with the loopindex tag.

    So, I fixed that, and added rulers and drop shadows, and some Regex to add commas... you can re-download it from the same link above.

  • andreluizgollo

    to center two objects, you need to calculate their total width (including the gap between them),

    then find the center of the screen,

    then subtract half of the total width of the objects from the center, so obviously half the total width is on one side, and the other half is on the other side...

    a couple things to watch out for: if you use "Scale Outer" to have your game fill the screen, then the left edge of the screen might not start at zero. So, I always calculate the center by doing:

    viewportRight(0)-viewportLeft(0) / 2

    you also have to factor in where the origin of the coin sprite is. If the origin is the middle of the sprite, then you have to add back in Coin.Width / 2

    I made a sample because it is harder to explain than to show... click the coin to randomly generate a new number and have it center the coin and text. Note: when you start my sample, the coin and text wont be centered until you click on the coin...

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

  • Constructyme2k19

    if you are talking about using touch to make sprite buttons that have a normal, hover, and down state, this is how I do it...

    I use a sprite I called TouchPoint that tracks where the touch is... this works with multi-touch or a mouse.

    each button has an instance variable that tells the name of a function to call so that you can make the button do stuff.

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

    if you are talking about changing the mouse cursor, that is something completely different.

  • boulerzzz

    the nice thing about the text object is that the text is always nice and crisp. SpriteFonts get a little blurry when zoomed too much. I found that using a high-res sprite font and scaling it down 50% generally gave the best results, and could still be zoomed in on without looking too bad...

    with only 12 fairly small objects, I don't think you will have a problem, but test it out in the debugger. I was working with a database and many hundreds of objects on screen at once.

    Ashley would have to answer whether changing colour every tick would be an expensive redraw or not. Changing the text content or size definitely would be, but position and colour might be ok... As long as your frame rate is good and the cpu utilisation is not too high, you should be fine.

  • boulerzzz

    I know on my iPhone and iPad that zooming does not work well if there are text objects on screen... the overhead with rendering text makes smooth zooming impossible. If you use SpriteFonts instead of text objects, then it may work fine. (it has fixed the problem for me)

    as a test, try hiding all text objects and then see if it zooms better...

  • I was playing with your example and came back to post, and saw that SnipG had the same idea I had...

    The problem is that the platform behaviour makes the box push up from the floor, so its Y value is not the same as the ground on either side (by a tiny fraction of a pixel). This could be considered a bug...

    anyway, I made a sample that turns off the platform behaviour and rounds off the Y value, and then it works the way you would expect. If you round the Y value without turning off Platform, then the box just pushes up from the floor again.

    In my sample, you can click on a box to see what its Y position is. When the box gets locked in position I change the animation so you know it can't be moved anymore...

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

    other options would be to not use the Platform behaviour for the boxes - use physics instead (but that has its own problems sometimes), or create your own manual system to push boxes around...

  • robotpencil there isn't a built in function. However, you can tell the sine behavior to just calculate a value... and then manually add it like you were doing. (so you don't have to do the math).

    I made a quick sample, based on the platformer template. All I added was a pet spite, and gave it two instance variables: Yoffset to track the pet's Y position in relation to the player. And dx, which tells us how fast the pet is moving in the x direction (so we can smoothly slow it down).

    Every tick, the pet's Y position is set to the current Yoffset + the sine value. And then we try to keep the pet in range of the player... sounds like you are pretty much doing the same thing.

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

  • I updated your capx to work with multiple water sections... just had to move the "Repeat 4 times" line to be under the "is overlapping water" section so that it uses the correct water y value.

    this way, (with the for each box) is probably slightly less efficient because it has to do each box independently - including the repeat 4 times code. R0j0hound's way did them all at the same time. As long as there are not too many boxes, it probably wont make much of a difference.

    you can get my file here: https://www.rieperts.com/games/forum/waterfloat2.capx

    oh, I added the drag and drop too, because it is so much fun! :-)

  • R0J0hound

    R0J0hound, that was awesome (as always!)... but what fun is it if you can't throw the boxes around?

    I added drag and drop, some waves (and walls to keep the boxes from floating away)... oh, and a little nudge occasionally to keep them bobbing.

    you can get my tweaked version of R0J0hound's capx here: https://www.rieperts.com/games/forum/buoyancy.capx

  • maxwell88 You probably are using an old browser (Internet Explorer) which doesn't support WebGL, or it could be a bad graphics card driver or a blacklisted gpu...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Awesome! :) good luck with your game!

  • AmpedRobot

    just saw this now... using Touch 0 and Touch 1 will probably only lead you into trouble.

    Because the index of the touches changes as new ones come and go... (which is what you discovered when you held the second one but let go of the first one).

    I think it is best to do it the implicit way from the sample I made last time.

    where you only have one "On Any touch start", "Is in touch", and "On Any touch end"

    those sections create, track, and destroy all the touchpoint objects (by TouchID) so there is no confusion.

    then it is up to you (using instance variables, or other ways) to define what the touch is supposed to do.

    I think that also makes things better for the player too - so that they don't have to know that something will only work with one touch, and something else with two touches - especially if their thumb is on the edge and they don't know it...