OddConfection's Forum Posts

  • Fupicat

    You can compare the LayoutName value in an event with the System->Compare two values condition then set the music to play based on that.

    Or if you really want to cut down on events, in an existing event you might have like On start of layout, add the Audio->Play by name action with the name set to:

    LayoutName = "Layout 1" ? "L1 Music" : "L2 Music"

    Obviously change the names to whatever you're actually using.

    You can also expand that if you add more layouts:

    LayoutName = "Layout 1" ? "L1 Music" : LayoutName = "Layout 2" ? "L2 Music" : "L3 Music"

    Edit: Actually you can simplify things by naming your music the same as your layouts and just setting Audio->Play by name to LayoutName

  • IGDev

    Add another variable to as a placeholder for the income to add, then do:

    Set tempToAdd to Acurrent + Bincome > Cmax ? Cmax - Acurrent : Bincome

    Set Acurrent to Acurrent + tempToAdd

    Set Bincome to Bincome - tempToAdd

  • mariogamer

    I think you might be able to use the source atop Blend Mode effect, to cut off the blood splatter on background objects.

    https://www.scirra.com/manual/146/effects

  • shuwand

    [quote:2fvr1we3]How do I make highscore with localstorage ?

    Add the LocalStorage object

    Add global variables Score=0 and HighScore=0

    Initialise your high score:

    System: On start of layout

    -> LocalStorage: Get item "HighScore"

    LocalStorage: On item "HighScore" get

    -> System: Set HighScore to int(LocalStorage.ItemValue)

    In your level end event (where you'd show the high score and have a restart button), add a sub-event:

    System: Compare Score > HighScore

    -> System: Set HighScore = Score

    -> LocalStorage: Set item "HighScore" to HighScore

    [quote:2fvr1we3]why my highscore always NaN..

    Use in() to turn the values returned from local storage into numbers, i.e. int(LocalStorage.ItemValue)

  • Ethan

    No worries.

    The delay is only a quarter of a second, which isn't very much at all.

    You can shorten it if you want, it just needs to be long enough to do a double-click.

  • Ethan

    You could use an instance variable to count clicks and use a timer so that after 0.25 seconds it checks how many clicks, opens the appropriate menu, and resets the variable to 0

    Example .capx (r233)

  • jakeedge02

    Add the LocalStorage object

    Add global variables Score=0 and HighScore=0

    Initialise your high score:

    System: On start of layout

    -> LocalStorage: Get item "HighScore"

    LocalStorage: On item "HighScore" get

    -> System: Set HighScore to int(LocalStorage.ItemValue)

    In your level end event (where you'd show the high score and have a restart button), add a sub-event:

    System: Compare Score > HighScore

    -> System: Set HighScore = Score

    -> LocalStorage: Set item "HighScore" to HighScore

  • some of which appear to be missing from that tutorial by the way (the LocalStorage.ItemValue follows on from an 'On item exists' check - in which the ItemValue is not passed!)

    https://www.scirra.com/manual/188/local-storage

    You might want to read that manual entry again - You can use LocalStorage.ItemValue in On item exists.

    ItemValue

    The value for a key that has been read or written in any Local Storage trigger, such as On item get or On item exists. This can be either a string or a number. This returns 0 if used outside of a Local Storage trigger.

  • Something like: "Exclude eventsheet but don´t kill the object".?

    You can't exclude Event sheets, but you can disable multiple Events using Groups.

    Add a Group to your Event sheet and move the Events into the Group.

    When you want to stop the Events running, use the action System: Set group active, select the Group and set it's state to Deactivated.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • luckyrawatlucky

    I've updated the capx so that the slider background shouldn't change size now.

    It's just changing the first event where the Tiledbackground width is set, replacing that action with:

    System: Set StepImageSize to TiledBackground.Width/Steps

    I'll upload it shortly to same link:

    capx (r233)

  • luckyrawatlucky

    You probably want to do something similar to snap-to-grid.

    I've made a stepped slider based on that here:

    capx (r233)

  • Aliigames

    Global number GridSize is 32

    Sprite:DragDrop is dragging -> Sprite: Set position to (round(Sprite.X/GridSize)*GridSize, round(Sprite.Y/GridSize)*GridSize)

  • Did you try adding the events I explicitly stated in your other thread?

    You didn't reply so I don't think even know if you read it.

  • Voted and added to my collection of C2 games on Greenlight

    Game looks great and judging by the comments on Steam, a lot of other people think so too.

    I don't think you'll have long to wait for the green light.

  • I was thinking about this option as a last resource since it may cause problems with not horizontal grounds, however is one posible solution.

    It would be nice for future uses having a "Is touching" event. There could be something done with overlapping a slightly bigger hitbox

    Using is overlapping at offset to look directly below the player should work for any slope that the player can stand on, it's just a matter of how far below it you look, which is why I used 16 instead of 1.

    Also, the at offset version of is overlapping does away with the need for a bigger hitbox, with the offset essentially acting like extending the hitbox in a particular direction.