oosyrag's Forum Posts

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

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

  • Try Construct 3

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

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

  • Can you take a screenshot on phone/pc and upload?

  • Layer two images of your ship sprite on top of each other. One for the interior, one for the exterior on top.

    While Player is overlapping ship, set exterior visibility to 0.

  • Steps to try:

    Change the Add 1 to powerGlove action to activate the group directly. Does this work? If not, you have a problem with your conditions. If it does work, then something is wrong with your variable. Make sure it is an integer and not a string perhaps?

    To confirm, try enabling the powerglove push system group with a simple keypress or mouse input and see if that works properly (remembering to disable the powerGlove=1 condition).

    Edit: Sorry just read more carefully and noticed you did say that your variable never gets updated. So it is most likely the Pick instance by UID condition that is not triggering. Can you elaborate on this logic why you chose to do it this way?

    Just hazarding a guess that the UID number is incorrect. Wouldn't it make more sense to check the animation frame of the object to see if it is displaying the powerglove item?

  • Quick answer: Yes.

    Slightly longer answer: Online multiplayer netcode may be more difficult than you imagine, especially with projectiles and a large number of actors in a real-time game.

    As for tutorials, you'll want to start here. https://www.scirra.com/manual/174/multiplayer

    You'll want to read and actually follow all the tutorials there. If there is anything you don't understand after going through those, it will be a rough ride making your own multiplayer game.

  • Wow that is an incredibly elegant solution to my example, thank you very much oosyrag. Sorry to ask more of you, but I've clearly not had enough coffee today - how would you expand that system to include more barrels, 3 or 4 or 5 say.

    Use an incrementing variable. So after each shot, add one to that variable, and use that to chose imagepoint, animations, ect... After it reaches the number of turrets, reset it back to 1. Remember imagepoint 0 is reserved for the origin). Or, you can do variable+1 when spawning from imagepoints.

    A fancy way of doing this is with a conditional operator:

    Assuming you have one imagepoint per barrel, and are not using imagepoints for anything else on that object...

    Upon firing, set ActiveBarrel to "ActiveBarrel<Object.Imagepointcount?Object.ActiveBarrel+1:1"

    This says "If the ActiveBarrel variable is less than the total number of imagepoints, then add one to ActiveBarrel. Otherwise, set ActiveBarrel to 1."

    This will cover any number of imagepoints you decide to add, and cycle through them one at a time.

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

    Use image points and toggle states, or an incrementing counter.