AllanR's Recent Forum Activity

  • 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...

  • Stenky

    dop2000's solution sounds like it would work fine... but I was curious how I would tackle that - and what the performance hit would be.

    so, I made a sample. The irregular shape of the provinces does make it tricky. but if you edit the collision masks to cover as much as possible (without adding too many points) it does seem to work well. Neither my computer or iPad broke a sweat... (debugger said it was using about 5% on both)

    I like to keep things as simple as possible and avoid plugins unless you really need the functionality.

    anyway, you can try my version here:

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

    it works with mouse or touch... but I only did 10 provinces. Obviously, there are some dead areas near the edge of a province if the collision mask doesn't cover that spot. In the code, I make sure to Pick the Top instance, just to make sure you can only select one province if the masks do overlap.

  • it might be a timing issue... how and when are you setting setting the dictionary key?

    Try adding a "Wait 0" action before the action that replaces the color. That might give it the time it needs to finish initialising the dictionary. (Just a guess)

  • You do not have permission to view this post

AllanR's avatar

AllanR

Member since 21 Nov, 2013

Twitter
AllanR has 23 followers

Trophy Case

  • 11-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

20/44
How to earn trophies