AllanR's Recent Forum Activity

  • the game uses a grid based on a tile size of 48 pixels, so all the walls of the maze must be a multiple of 48 from the left edge. Setting the layout size to 1920 x 1080 and moving everything to the middle puts the walls half way between that 48 pixel grid. so moving everything 24 pixels left or right will get things lined up correctly and it will work.

  • that makes a nice curve...

    I made a quick test to see what a graph of it would look like:

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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I would be tempted to just calculate the percentage of the player's stat against the max for that stat and multiply that by the max duration.

    so, set Timer to: Player.Wisdom / MaxWisdom * MaxDuration

    if MaxDuration is 30 seconds, MaxWisdom is 9999, and Player.Wisdom is 500 then Timer = 1.5 seconds

    Player.Wisdom = 2000, then Timer = 6 seconds

    Player.Wisdom = 5000, then Timer = 15 seconds...

    that is very linear, if you want a curve with diminishing returns then you need some kind of an inverse exponential function, such as duration = 1/(x^2). (and mess with the exponent to adjust the steepness of the curve.

  • the event sheet is already a loop - it gets executed every frame of the game, so you don't need the while

    just have an event that checks if the sprite is overlapping the button, set button invisible, then an else set button visible.

    another option is to make buttons out of sprites...

  • Very nice Dop! :)

    DeathSpecter9 - there are a probably a few ways to fix that, I moved the origin to make sure other shapes line up on the same grid...

    I recreated the level from the picture you posted above, and it works quite well.

    not as fluid as the movement of the real game, but pretty close - and only 4 events!

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

  • to get the colour of a pixel, you will have to use the canvas plugin, paste the sprite to the canvas.

    Then you can use Canvas.redAt(x,y) Canvas.greenAt(x,y) and Canvas.blueAt(x,y) to get the rgb values.

    there are lots of other ways to make maps - load json data, tilemaps, etc.

  • I gave it a try... you have to do all the scaling manually, and calculate what should be visible or not.

    here is what I came up with - it can zoom in or out indefinitely, although I didn't have it show simplified labelling the way the program you linked does. I also don't zoom into the mouse location.

    drawing graphs gets very tricky! if the canvas size does not match the screen resolution, then the lines will get blurry, different thicknesses, and lighter or darker than their neighbours - which looks terrible.

    so, you have to set the canvas size to match the window size if you want nice looking lines.

    Use the mouse wheel to zoom in and out, and you can use the left mouse button to make lines: click and hold to make the first point, drag to another location and release to complete the line. when you zoom, the lines get updated.

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

    oh yeah, since I am resetting the canvas and using scale outer to use the whole screen, you can't assume that the top left screen coordinate is 0,0. So you MUST ALWAYS add in viewportLeft and viewportTop to make sure you are where you think you are on the screen. It took me a very long weekend of work a year ago to figure that out - and you would not believe how subtle that mistaken assumption can get!

  • I made a version of spider solitaire a couple years ago, and I used an array to create the deck, shuffle it, then spawned all the cards onto the screen - as each card is created it is assigned instance variables that tell it what the face value is, what suit, whether it is face up or face down, and what column it is in.

    after every move I would calculate if cards are movable or not, and if any complete suits exist.

    I used another array to hold each move, so that moves could be undone.

  • it is not really simple. The built in behavior is not designed to do what you want - you will always be able to move a piece faster than you can check for obstacles. So, you will have to make your own drag and drop.

    I remember taking a stab at it months ago when you asked, and decided it would take more effort than I had time for. I would probably use an array to hold the occupied positions on the board and calculate if the piece can get to where you want to move it...

    like all awesome games, an elegant and flawless interface takes a lot of work!

  • after you add the second condition, right click on the event and choose the first option after the Add... line, it should say "Make AND block". (if you do that again it will say "Make OR block" - you can toggle it back and forth as required).

  • yeah, you were pretty close :)

    You were reading the mouse position from the layer that was scrolling, and that can lead to wacky results, so I changed it to read from the non-scrolling layer (Reduced Size), and then set scrollx based on the mouse's relative position from where it started.

    I set the indicator to a scaled down relative position as well. I moved the indicator to the non-scrolling layer because I thought it was easier that way.

    I disabled drag and drop on the indicator, because it was easier to just reverse the scaling if the mouse clicked on the indicator instead of the background. I also used Clamp when setting the indicator so you don't have to separately check if it has moved beyond its limits.

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

  • a Global string works exactly like a numeric one, only it hold text instead of numbers. That way you can use words, like "Red" and "Gold" rather than codes like 1 or 2.

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