AllanR's Forum Posts

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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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

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

  • since your squares and walls are a factor of 32 pixels apart, another option would be to set the x to the nearest 32 pixel boundary:

    x = round(self.x / 32) * 32

    I also tried speeding up the squares as they drop down a line, but they gradually get farther and farther apart because they are at different speeds for short periods of time.

    if maintaining the space between them is important, then you might want to use an array to hold all the positions of the "head" square, and set the following squares to a relative place behind the head...

    I helped someone with that concept who was making a worm game:

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

  • I made a bunch of little changes - added a couple global variables for projectile type, and changed some animation names to match the projectile types to make it easier to set the one you want.

    I removed some of the "on animation finished" events because they weren't needed - the fade behavior automatically destroys the object when the fade is finished.

    I restructured a couple events, removed some duplicate code, and added a couple checks for game over so that the game can't continue after you are dead...

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

  • I like the art :)

    what happens is that event 3 fires a red HWB, and event 9 fires a gold HWB (if the highscore is over 80).

    if the highscore is over 80, both are fired, but you make the red one invisible, and the gold one visible (down in event 26).

    both projectiles will hit the enemy, so both events 10 and 11 will run. Since the gold projectile is slightly faster, it will hit first and then the red one hits and changes the animation to f1 (red HWB) right after the it had been set to the f4 (gold HWB). If they hit at the same time, then the f4 animation is set last so you will see the f4 animation.

    so, you don't want to fire the red HWB if you are going to fire the gold one.

    or you might want to make the gold one a new animation of the red HWB, and then set speed as necessary. That would remove duplicate code...

    there may be a bug with the end of game not always stopping play, but I didn't look into that.