oosyrag's Forum Posts

  • Try a horizontal sine behavior movement with increasing magnitude and speed while applying a steady upwards acceleration as well.

  • You would use it as an expression in the System - compare two values. First you would have to pick the powerup (I'm guessing by colliding), then you would system compare two values Powerup.AnimationFrame = x?

    The condition Isplaying is a little bit not quite right for your situation, so I recommend optimizing it a bit more even if it works as you have it right now. Just in case to prevent future issues.

  • Your question is a bit unclear....

    But try adding the "Every X Seconds" condition to your event to have it keep firing.

    Alternatively, add Wait and additional Spawn Bullet actions if you want a fixed number of bullets.

  • Generally speaking, when you click your button, you will need to "pick" your tower to be upgraded with conditions, so that your upgrade action only applies to the picked tower. There are many ways to pick, depending on how your project is set up.

    A safe way is to pick by UID, which you can save to a variable as an action when you select a tower to begin with. I recommend storing this in an instance variable in the upgrade button. Let's call it SelectedTower.

    On tower selected (on clicked/touched?) - Set instance variable Button.SelectedTower to Tower.UID

    On upgrade button clicked,Pick tower by UID Button.SelectedTower - Do upgrade tower action

  • I'm not sure if it works, but does rotating the layout affect gravity?

  • Use a 1 pixel width line stretched from each data point to the next. Set length and angle with a little math.

    Or use the Canvas third party plugin to draw lines.

  • I'm assuming this has to do with interacting with objects under your ui elements rather than a visual thing... as you shouldn't be able to see your objects if there is a ui on top of them anyway.

    As long as they exist, they will be under there, so you may want to add a condition to check if there is any other UI under your mouse click/touch as well before doing the action. A UI Family would be useful for this. For example, on touched object, is NOT (right click a condition to invert) touching UI (family) - then do something.

    As for scroll to, you can use scroll to position instead of scroll to object to get an offset. For example, Scroll to PlayerX+100, PlayerY would give you your player offset 100 pixels to the left of center.

  • Possibly on the last event make sure the value is an integer with int(LocalStorage.ItemValue)? Not quite sure... I imagine it IS getting something, otherwise the high score would remain at 0.

    Or does it have the same problem with all the localstorage events disabled as well?

    Edit: I don't see where you set the HighScoreText to HighScore anywhere... Maybe you're just not displaying the number? When you check in debug mode, does the highScore variable show the correct number? Reference capx: https://www.dropbox.com/s/m5u06uuk9fh78 ... .capx?dl=0

  • No seriously that article should cover everything you need to do. Just because the title of the tutorial says multiple shadow lights doesn't mean you need to use them all. The techniques applied to one are still relevant.

    Fade range

    [quote:9cgbch3p]Let's start with one opaque black layer, which gives us complete darkness. Then we add the "mask". This is a white circle with the alpha fading to transparent around the edges.

    Put your object/copy on a layer above to have it show original color.

    [quote:9cgbch3p]Other layers on top cannot have this lighting applied, since by the time they are rendered the background already has the light map applied. It's sort of "baked in" to the image by then, and you can only multiply with the final result, which isn't very useful. Arguably however it is useful that now you can put new content on top without it being affected by lighting, e.g. the HUD.

  • OK I get what you are trying to do.

    Here is an example.

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

    Basically you'll want a list of valid targets stored in an array. This array will contain the value you want to sort by, as well as the UID of each sprite, which allows you to pick the correct one you want to snap to.

    Then by using an incrementing variable with the array, you can look up which sprite is next or previous, and set your selector position to that sprite's position.

    To compact it more, you can use the array expression IndexOf to get the current position of your selector instead of storing it in a variable... but then you start sacrificing readability.

  • I don't think you can input expression in the property editor.

    Why not use an event? Generally it would go in On Start of Layout, which you probably should have for every layout anyway, so it doesn't add to your event count in case you were worried about that for the free version or something.

    Also when you start working with any significant amount of text, it becomes more and more unweildy to use the properties bar to set text.

  • Try setting the size of the temp array upon calling the function, rather than in the loop?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Get the system time - https://www.scirra.com/tutorials/940/ho ... -a-project

    Convert to base units of seconds.

    Record via variable/localstorage/ect.

    Compare with last recorded system time on resume to calculate how much time has passed.

    This system is cheatable by modifying the system time. Otherwise, you will need a server side time check. Or, figure out how to request the current date/time from a timeserver.

  • As you said, your temp array is empty the second time you call shuffle... So before you shuffle, you need to rebuild your temp array. Either copy your current array to the temp array to shuffle the remaining cards, or populate it from scratch.

  • So basically you were taking advantage of the fact that buttons did not trigger the "on tap" condition, while sprites do. To solve this, add a condition to your ”on tap"event - an inverted "is touching" spriteButton.