AllanR's Recent Forum Activity

  • are you using SSL? you browser will block access if it is not secure. You can press f12 to get to devtools and check for errors...

  • I keep all my touchable objects in a family, then on touch "Pick top instance" filters out all instances below the top one.

    all of the touchable objects also have an instance variable saying which function to call when they are touched. So one place handles all the touch / multi-touch logic, then when it is determined what was touched it branches to the function that handles what happens from there.

    if I want a button or group of buttons to be modal (so that nothing else on the screen can be touched), I use an invisible object called ButtonShield that is part of the family and expands to cover whatever area I want, but has a blank function variable and it goes just under the active buttons in z-order. (since I always use pick top instance, this blocks any other objects below the shield)

    there are a bunch of other tricks to make a user friendly, proper multi-touch, intuitive UI. It is harder than you would think, but C3 gives you all the tools to make it work exactly as you want.

  • you should only need one array to do what you are describing, each row in the array can hold multiple values

    first entry:

    array(0,0) = x value, array(0,1) = y value, array(0,2) = Position

    second entry:

    array(1,0) = x value, array(1,1) = y value, array(1,2) = Position

    you would define the array size as (#entries,3,1)

    however, if you know you have a 6 x 6 grid, it should be pretty easy to calculate the x and y values when the position number is 1, unless I don't understand what you have in mind.

    it would help if you made a mock up of what the final screen would look like, the 6 x 6 grid, and safe path for the player to follow.

  • this is what I do for UI element shadows - use a seamless 9patch shadow png (so it can be scaled to any width/height without distortion).

    since it is pre-rendered, there is no blur performance hit. Obviously this only works with rectangular objects. This demo creates 10 random shapes with a shadow - the shadow has a fixed offset but the opacity is random. The objects have drag and drop so you can move them around...

    In the top left corner I included a white version of the shadow png so that it can be coloured, but I normally only use black shadows.

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

  • I gave it a quick shot too... I made it like a joystick, so it auto selects the center position unless you are pressing a key. I prefer arrow keys so I used those. I don't have a gamepad to test with so it is keyboard only.

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

  • your code will try to mute the sounds every tick - as long as the boolean is false.

    there could be other places in your code that are running every tick that are undoing the mute on certain sounds.

  • in event 7, where you add child ButtonText, you are not picking one instance of ButtonText so ALL instances are being added as a child to Button, and then they are all getting the same properties.

    If Button was a container, then each Button would have its own instance of ButtonText (but families can't be a container). So, you can create an instance of ButtonText for each Button, or if they are already on the Layout, pick the nearest instance or use some other way to associate a ButtonText with the appropriate Button (and pick just that one instance).

  • I would give the PlacementLocation an instance variable "Filled" or "Planted" and set that when you plant something. Then before planting anything else check if that it set. Clear it when you harvest.

  • in your previous post, you are checking CornCrops Overlapping CornCrops. That should be CornCrops overlapping PlacementLocation

    I would place the code to set the Animation frame in the event that increments the growth variable since that only runs every second. The way you are doing it will work fine, but it has to calculate the frame every tick (60 times a second) and it wont be changing that often. The less unnecessary work you do, the faster your game will run (and use less battery if you are aiming for mobile).

  • you will probably want to add a TimePlanted instance variable, or maybe a countdown variable until the plant is full grown...

  • you have the PlacementLocation and CornPlant2 reversed in the final event where you want to destroy the CornPlant2 instance.

    the way you have the event condition makes it "pick" PlacementLocation instances, but you want to pick CornPlant2 instances. So your Destroy CornPlant2 action destroys all of them since all are picked by default.

    so saying CornPlant2 is overlapping PlacementLocation will pick the instances you want since you already have the correct PlacementLocation picked.

    I would put all crops in a family, and give the family an instance variable called Location, and assign that variable when the crop is spawned. Then you can pick crops by their location.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • that actually turned out to be slightly harder than I expected... maybe I am just tired :)

    this file merges 3 arrays loaded with AJAX at the start. It also populates a drop-down list so you can check that the levels match the project files... each project file is only 10 sheets of 8x8 cells but it will work with as many sheets as you can give it. The AJAX data is loaded into a TempArray. The LevelsArray starts out with a depth of 0 and then each sheet is pushed on the back of the array as it is loaded.

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

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