Squish's Recent Forum Activity

  • Mediafire seems to be dead for some reason - I'll get back to you.

    http://downforeveryoneorjustme.com/mediafire.com

  • A timeline might help here

    Create a new timeline and keep it as a separate object if you're using other timelines already (this will prevent future issues).

    Set the first period (eg "Main") to -1 duration, making it run indefinitely

    Set the second period (eg "Timeout") to however long you want the delay to be, eg. 2 seconds.

    When your trigger event starts (eg. arrow hits = 15) end the first period ("Main")

    Set the layout to change/end when the timeout period ends

    OR

    Make a function "end layout" using the function object

    When arrow hits = 15, call function after delay of eg. 2000ms

  • OP -

    Why are you loading your sounds to channels? Does your game specifically require control over each channel?

    Otherwise, just use autoplay file [at]* object for all your sound needs. Make sure your .wav files are all in standard frequencies:

    44,100

    22,050

    11,025

    16/8 bit, mono/stereo

    *optional

    If you want to specifically stop a certain object from playing whichever sound: use a PV and set it to "xaudio.lastautoplay" when it's played. Then xaudio "stop channel" (PV).

    Mik

    Have you made sure that you've checked 'Cache sounds under x MB' (def. 3)? Also - if you want sound to fade between layouts, the layout transition 'fade' does this for you (if that hels)

  • random(2) will give you 0,1 or 2 from what I've seen so far. Maybe that requires a little messing around with .caps.

  • Are we looking for something professional in appearance, or humorous or something in between?

  • Hey, nice. I didn't notice that you can get original width/height.

    Cheers for that Tula.

    As an add on:

    If you have non-default sizes to start with, you can store those at layout start into private variables.

    Eg. On layout start

    Set "origWidth" = sprite.width

    Set "origHeight" = sprite.height

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • As an action to any given event:

    System: Create object

    Inside that there will be x and y coordinates. You can use expressions (such as "get x of ____" and calculations such as "displaywidth/2").

    One of my debug tricks is to spawn an object at a random screen position by using

    Create object at

    x = "random(displaywidth)"

    y = "random(displayheight)"

  • I love using else.

    However, I don't think I have any excuse for this. Well, actually I do have one favourable thing to say about it: It works.

    Open in a new tab, it's huge. (And pardon the artifacts - I reduced the quality in favour of filesize reduction).

    http://i38.tinypic.com/n1wack.jpg

    E: Forgot to explain a little

    I had a major logic problem with arranging the little dudes at the bottom of the screen. They just wouldn't play nice for every particular combination of positions that they could be in when the final count is done. I've tried 3 major revisions of this and nothing ever worked for all combinations.

    This was the brute force approach where any specific arrangement that would cause problems is handled slightly differently to the general approach.

    If nothing else, it should provide some amusement.

  • For sequencing events like this, I find that using timelines gives me more control.

    Eg. In my project I was doing an instructions screen where I have some sprites from the main game in a looping example. Ie. dude gets shot, falls down, goes splat, repeat. The timeline is set up so that each period can only advance by trigger (by making each period -1). The trigger to advance is a specific event, which in this case is the collision event. This forces everything into a nice sequence.

    So your timeline might look like:

    Period      Name     Interval    Duration
    1             Idle           0             -1
    2             YouDied     0            -1
    3             Fading       0            -1
    4             ExitLayout  0            -1
    [/code:34nirq2d]
    Note the first one is an idle state, because a timeline will start automatically at the start of the layout or when loaded.
    
    On Collision between enemy and player
     DeathTimeline finish period "idle"
    This will then begin the automatic sequence. If you want it to strictly be time based (eg. 5 seconds) then you can make your timeline do that instead of being -1 and waiting for an end period command.
    
    On DeathTimeline period start "YouDied"
     Do your usual player died stuff, such as playing sad music, subtracting 1 from lives, starting enemy gloating animations etc.
    
    During DeathTimeline period "YouDied"
    Player.y is > scrollYbottom (ie gone off the bottom, mario style)
     DeathTimeline finish period "YouDied" 
    This starts the fading period.
    
    On DeathTimeline period start "Fading"
    Do your fade thing here. You could use a during period event here that will basically be an "always" as long as the current period is running. 
    
    On (screen is fully faded, etc.)
     DeathTimeline finish period "Fading" 
    
    And go from there
  • A slightly hacky way would be to get the object's width/height first.

    So

    On (somevent)

    set sprite1 width = sprite1.width/2

    set sprite1 height = sprite1.height/2

    This should halve its size. If you want a specific percentage, try multiplying by decimal fractions.

    eg. 50% = 0.5, 10% = 0.1, 33% = 0.33

    set sprite1 width = sprite1.width*0.5

  • Thanks Davio - I was a little rusty on those parts. Those exact two points are literally where I stopped and thought about it.

  • Hah, yeah I was messing around with timescale a couple of days back. That was fun. I like the way sound effects slow down to match.

    I'm glad I've tied all my events into timedelta now. I could have a slo-mo powerup that gives bullet time properties to my game. The firing control isn't in timedelta yet, but I think I'll leave it that way because of the way it turned out.

Squish's avatar

Squish

Member since 2 Aug, 2010

None one is following Squish yet!

Trophy Case

  • 14-Year Club

Progress

14/44
How to earn trophies