oosyrag's Forum Posts

  • https://www.scirra.com/tutorials/37/beg ... onstruct-2

    https://www.scirra.com/tutorials/253/ho ... tform-game

    These are the best beginners tutorials. If you go through them, you will be well on your way to making games.

    As for videos, check out the C2 Academy channel on Youtube.

    https://www.youtube.com/playlist?list=P ... 6HHrKJi95r

    I myself have no patience for videos, so unfortunately I don't have a recommendation on which video may be the best to start with, sorry!

  • Didn't get a chance to check out 99's solution since I'm not on latest beta, but here is one working to my satisfaction. It uses the spawn helper itself to check for open spaces around the blocks, then moves them to the correct image point.

    https://www.dropbox.com/s/jy04myos0p47s ... .capx?dl=0

    This bypasses the issue where adjacent collision boxes count as overlapping (the helper sprite is smaller than the block sprite), and you don't want to shrink the collision box on your block because you need it for your platforming behavior.

    Pseudocode:

    For each block, check if space above is empty with a helper.

    If it is not empty, destroy helper sprite (and try next block).

    ELSE if it is empty, destroy the helper above

    Then make a new helper to the left of that block and pick all blocks to check collisions.

    If collides, destroy that helper. Else, move it to the corner.

    Repeat with a helper to the right of the block.

    By the way, this should totally work if you manually set instance variables defining left/right corner, so I'm not sure if you're interested in troubleshooting why that wasn't working. The method I'm using right now is meant to save you the hassle of manually setting corners (as variables) in case you have a large level in the future.

  • It seems like when you have object bounding boxes directly adjacent to each other they count as overlapping, so this solution might not work as I expected to at all. Gonna think of another way. But don't worry, I'm sure it can be done

  • Here you go. I got to experiment a bit and realized I left out the Pick All. Originally when you do For Each, only the active block is picked, so when you check if its colliding with any other blocks around it, it wouldn't because the only instance it sees in that event is the currently active one unless you use Pick All.

    https://www.dropbox.com/s/88osdmr15uv1m ... .capx?dl=0

    Not quite finished, as you can see with the one at the bottom of the U, but hopefully it will get you going in the right direction.

    Edit: Still broken in several situations, I'll try to refine it a bit...

  • Ok so here is a method to spawn helpers for sprite objects. It will work even if every single tile is the same, but will reduce the loops required if your corners are already defined. Basically you check if your block is a corner, and then you check the space to the left or right of each one to see which side is open. Then based on that you will spawn your helper block at the correct position.

    Set up: For your corner animation frame in your block object, make two image points, one in the top left and one in the top right.

    Event:

    For each BlockObject

    Compare Values AnimationFrame is CornerFrame

    BlockObject is NOT overlapping at offset BlockObject.Y+BlockObject.Height (Check to see nothing is above it)

    Subevent 1:

    BlockObject is NOT overlapping at offset BlockObject.X+BlockObject.Width (Check nothing is to the right)

    Action: Spawn HelperBlock at BlockObject's imagepoint top right

    Subevent 2:

    BlockObject is NOT overlapping at offset BlockObject.X-BlockObject.Width (Check nothing is to the left)

    Action: Spawn HelperBlock at BlockObject's imagepoint top left

    Note that for this method if there is a single block by itself, it should spawn helpers on both sides. Up to you if you want that to happen or not. If you don't, you can add an ELSE to the second subevent.

  • Is that a tilemap? Are all blocks the same or do you have specific corner type blocks, floors, and walls?

  • Have you tried it? I don't expect any performance issues, either way you do it. Just whatever is more convenient for you.

    You can have each of your corners spawn a helper sprite. Or you can put them in a container and use a system-create at x,y to create the corner and helper together. Or you can use a tilemap position of your corner tile to spawn a helper object.

    You're going to need to be more specific, there are a ton of ways to spawn an object. How to do it depends on your situation.

  • Run a loop with a variable counter 50

    While counter > 0

    Pick random spot

    If spot is NOT within minimum of distance of tree - Place tree at spot, reduce counter by 1

    (if it is too close to a placed tree, the event will run again without reducing the counter and pick a new spot to try)

    Edit: Depending on the availability of space for placement, this can be a very inefficient method. If there is not much space left for that last tree, it might loop a ton of times before randomly hitting that spot.

  • Arrays can store strings too. It doesn't have to be a number.

    You'll definitely want to get very familiar with arrays and array manipulation if you are doing a card based game.

  • Helper sprites are always useful and usually the quickest, simplest solutions.

    For a event only version, you would be saving the Touch position to a variable On Touch, and comparing that to the current Touch.X position. With the condition Is In Touch, you can use Scroll to X where X is the difference between scrollx (current screen position) and Touch.X-OriginalTouch.X (length of drag). Depending on where scrollx ends up closest to, you can then set the Scroll to X to the appropriate screen On Touch Released. To get things smooth, lerp can be used as well.

    But yeah I would definitely recommend just sticking with a helper sprite as long as you are satisfied with the result.

  • It sounds like you want to use containers.

    Put the Text Object in a container with the Turret Object. When you create the Turret object, it will also create a Text Object that you can then set the text to.

    The result of this is whenever that Turret Object is picked, such as On Bullet Collide with Turret, the associated Text Object will be picked as well, so you can do Set Text to Visible.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Manually positioned animated sprites. Assuming you are not using unique tiles/animations, you only have to load the animated sprite into memory once for all instances of it.

  • Add For Each

  • Thanks for that! I'll give it a shot and see how it goes for html5 export.

  • I have an issue where upon focusing on a textbox to input on mobile (android, chrome), the on screen keyboard will come up and push the textbox off screen. This results in the textbox getting unfocused, and the on screen keyboard going away.

    On a friend's phone (ios, safari), there was the alternative strange behavior where the textbox would get pushed off screen and stay active, but only one digit could be entered.

    Can anyone help me confirm that this happens across other devices and if so, any ideas how should I address it?

    To replicate, scroll down to the bottom and select one of the uppermost textboxes. It works fine if you select one in the middle or bottom of the screen. The problem only occurs when the osk pushes the active textbox off screen.

    Capx: https://www.dropbox.com/s/6rpnt4qtghmo3 ... .capx?dl=0

    At the bottom was an attempt to keep the screen in the same position when the keyboard comes up, but that didn't quite work either. The screen would stay in place, but the osk would pop up and disappear.