Squish's Forum Posts

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

  • Tulamide's pretty much nailed it, but even I got confused reading the second last paragraph.

    Images are stored with a fixed amount of pixels - eg. 512x512, and that takes up a certain amount of space (format, compression etc).

    When it comes to printing, and the dpi/ppi (dots/pixels per inch) is relative to physical size on paper. Monitors are fixed at either 72 or 96 dpi (I'm not certain which). Either way, it doesn't matter on screen because everything is measured in absolute pixels, regardless of resolution or screen size. 512x512 on a 36" monster screen will be physically larger than 512x512 on a cheap 14" LCD.

    Paper is a different story, because it doesn't have pixels, rather it has cm/inches. Most printers will do 300dpi at least, but 600 and 1200 dpi aren't uncommon, particularly in laser printers. What happens is your 512x512 image is upsampled to 300/600/1200 dpi by the print driver. Ie. it stretches that 512x512 to 2135x2135 (300 dpi), or 4264x4264 (600dpi).

    This is why printing jpgs from the Internet makes them look jaggy and terrible, because they're upscaled so much.

  • That's probably worth submitting as a bug, including the solution you found. That way they can patch it up.

  • There is a wait object that can put a delay into actions. It depends if you are trying to simply delay something within the action, or if you want it paused indefinitely.

    To delay an action:

    On <some condition>

    --Do: create sprite1 at x,y

    ------ play sound "somesound.wav"

    ------ wait 2,000 ms

    ------ change animation to "DoneTaunting"

    If you want the action paused indefinitely, then I have no idea how you might do that. I would look at using some kind of toggle condition rather than trying to switch at the action level. Something like:

    Is global('Something') = 1

    --Do: Set global('something') = 0

    If you don't set it 0 immediately, then this action will repeat every tick (unless that's what you want it to do).

    ---- do other things

    On SomeOtherCondition

    --Do: set global('Something') = 1

    Note:

    I've found that wait acts strangely in loops. What I *think* is happening, is that each iteration of the loop starts another wait cycle in parallel, effectively nullifying it.

    If I did:

    ON SomeEvent

    --Repeat 12 times

    ------- spawn an object

    ------- play a sound

    ------ wait 1000ms

    I find that all 12 appear instantly, and all the sounds play seemingly at once. It's as though 12 'waits' are created simultaneously.