dlunsford2650's Recent Forum Activity

  • Hello! I'm building a game where players build a course with draggable blocks in order to guide a ball to the goal. It is kind of hard to explain, but easy to understand when you play the game.

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

    I want to limit the number of blocks the player can use on each level. At the beginning of each layout, I set a global variable called 'blocksAvailable' to a specific number, depending on the difficulty of the level. For instance, on level 1, I set the blocksAvailable variable to 5, so the player has 5 blocks to use.

    I subtract 1 from the blocksAvailable variable anytime a player drags and drops a block anywhere other than the UI block (at the bottom of the screen) or one of the red barrier blocks.

    Here is where the issue comes into play. If I accidentally tap one of the blocks I've already placed on the grid, it subtracts 1 from the blocksAvailable variable. Each block should only be able to subtract 1 from the blocksAvailable variable. I've tried to control this by using the "Trigger Once While True" system event, using a variable called "placedOnGrid", and a couple of other ways I can't recall right now. None of my attempts have solved the issue.

    Eventually, I want to add the ability to flip blocks along their X axis by double-tapping them. This won't be possible if I can figure out a way to resolve this issue. Any help that can be provided would be greatly appreciated.

    Please let me know if any additional information is needed.

  • Thank you so much! I really appreciate the suggested fix and the advice about mixing physics with other behaviors. I'm going to take another look and see if there is another way I can accomplish my intended outcome.

    Thanks again!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hey everyone,

    I'm fairly new to Construct and am encountering an issue I have been unsuccessful in resolving for several days. I have combed the forums and spent a lot of time testing different solutions, but nothing has worked thus far.

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

    Game Objective

    The goal of the game is for the player to create a path using the available blocks at the bottom to reach the goal (checkered black and white box). When the player drags a block overlapping another block or within LOS (64 pixels) and drops it, the block will pin to that block, allowing the player to construct paths for the ball fairly quickly. I'm using families to control the majority of the logic for the blocks. Using families resolved a lot of the earlier issues I was having (instances of the same object type not pinning together, etc.). However, it has caused a new issue I wasn't encountering when not using families.

    The Issue

    When a block leaves the UI block and is dropped on the blue tiled background, collisions with the ball should be enabled. When a block is being dragged, collisions with the ball should be disabled. This works for the most part, except when I'm dragging an instance of a block that already exists on the blue tiled background. Collision is disabled for all instances of the object type, not just the block I'm dragging.

    Solution Attempts

    I'm willing to bet the issue comes from a lack of understanding on how Famiilies function on my part. Here is what I've tried so far to fix the problem:

    1.I tried creating a Boolean instance variable on each individual block instead of the family called 'canCollide'. When a block is dropped on the grid, the 'canCollide' Boolean instance variable is turned on. When a block has the 'canCollide' instance variable set to true, collision with the ball is enabled. This didn't seem to make any difference.

    2. Stop using families and program each individual block. The issue when I do this is I can no longer pin instances of the same object type to each other, which is critical for the "feel" of the game. Pinning blocks to one another has to be fast.

    Any help you all could provide would be hugely appreciated. Please let me know if any additional information is needed. Thank you!

dlunsford2650's avatar

dlunsford2650

Member since 23 Mar, 2021

Twitter
dlunsford2650 has 1 followers

Trophy Case

  • 3-Year Club
  • RTFM Read the fabulous manual

Progress

4/44
How to earn trophies