Yann's Forum Posts

  • I don't have that kind of issue on cubemaze. The main music (kinda weird sound that appears progressively) and the woosh in the intro are in the music folder, and the other sound plays nicely.

    Also, if you test on localhost, the downloading phase should be pretty fast so following your hypothesis, the sound in the sound folder should plays after like 2 or 3 seconds.

    Try to create a test capx the best you can with sound and if you can reproduce your bug, send it over here (:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • cx,cy are the coordinates of the center of rotation

    xR,yR are the coordinates in a rotated layer at angle layerangle

    x,y are the coordinates in an unrotated layer

    x = cx + cos(-layerangle) * distance(cx,cy,xR,yR)

    y = cy + sin(-layerangle) * distance(cx,cy,xR,yR)

  • 1/ don't forget to tag your sounds when you launch them (I always do that)

    2/ sounds are kinda global, if you launch a sound and you restart the layout the sound won't stop. In your case you can do

    System: On start of layout
      Audio: stop sound tag "music"
      Audio: play sound tag "music"

    This way you're sure the music isn't played twice

    If you don't want to restart the music but let it play without duplication you should use a global number

    Global number music = 0
    System: On start of layout
    System: music = 0
      -> Audio: play sound looped tag "music"
      -> System: set music to 1
  • in your game, as I remember, you had something like "every 3 seconds, pick random enemy and shot"

    But this value "3 seconds" cannot be changed as it is. You cannot transform an every 3 seconds into an every 2 seconds. 'Cause the value is kinda hard coded.

    However, if you use something that represent a number instead of a real number, you just have to change this representation.

    It's basically what's great about variable.

    Let say I create a variable that represent the fire rate

    let's call it fireRate. And let say it's a global variable 'cause it conserns many objects.

    Ok so we have this variable. Now instead of "every 3 seconds" we write "every fireRate second"

    Now you can modify however you want this representation. If you set fireRate to 2 it will be "every 2 seconds" if you set fireRate to 0.5 it will be "every half a second" etc.

    The same idea goes with "in which level am I ?"

    That's not the true question, the true question is "how many Level did I win?"

    So you can have a variable named "level" to which you add 1 each time you win a level. But as a matter of fact, this value will also represent the level you're in, 'cause each time ou win, your level should increase.

    And then you just have to put in a text box

    set text to "Level "&level

    In short variable are used to control what can vary in a program.

    That's all

  • or simply

    sprite: set X to centerX + cos(angle) * radius
    sprite: set Y to centerY + sin(angle) * radius

    if the radius value is the same for X and Y the sprite will be on a circle of this radius

    if the radius values are different the sprite will be on an ellipse

    That's the basic formula I used for my menu in cubemaze (see below)

    Ok I've been kinda ninja'd on this last one. Shouldn't have taken a shower after opening the topic. well..

    For the "Shake many objects but not these ones" it depends

    If you don't want your HUD to shake you can put all your HUD elements on a layer with parallaxe 0,0 (will never scroll)

    Else you will probably have to shake your layout with a scoll+random(-10,10) and counter shake object you don't want to shake by putting them in the same family and applying the inverse translation.

    +on what  you want
      local number randX = 0
      local number randY = 0
      local number curScrollX = 0
      local number curScrollY = 0
      +System: trigger once
        // store real position on start of shaking
        -> System: set curScrollX to scrollX
        -> System: set curScrollY to scrollY
        -> NoShakeFamily: set self.realX = self.X
        -> NoShakeFamily: set self.realY = self.Y
      +System: every tick
        -> System: set randX to random(-10,10)
        -> System: set randY to random(-10,10)
        -> System: set scrollX to curScrollX + randX      //Shake
        -> System: set scrollY to curScrollY + randY      //Shake
        -> NoShakeFamily: set X to self.realX - randX      //Counter-Shake
        -> NoShakeFamily: set Y to self.realY - randX      //Counter-Shake

    might work :D

  • well there's some hiddent trick

    in the first event, each instance of enemy is matched with each instance of arrow by their IID

    But in the comparaison you have to pick the proper arrow else you influecne all of them.

  • picking problem (:

    picking.capx

  • if you want to stop the fade behavior you can set the object's timescale to 0

    Set it to 1.0 and restart fade to fade.

  • Oh don't worry, you CAN'T invert triggers

    Try you'll see put a "on ended" "on touch" "on collision" you'll see the invert option grayed out.

    Inverting a trigger is just nonsense

  • You do not have permission to view this post

  • You do not have permission to view this post

  • Sheep, you enter the realm of "variables"

    All your question can be answered by using them.

    Use a global number that store the level you are currently in, when you start another one just increment it

    For the fire rate, just put that in a variable and instead of every 3 seconds do an every fireRate second then you just have to modify the variable when you need.

    etc :D

  • Weishaupt Never invert Triggers

    2Bdigital

    works fine for me soundTiming.capx

  • send me a simple .capx with what you managed copy from my solution

  • local variable are either global variable you nest under an event (drag&drop under an event and slightly to the right so it gets nested)

    or

    something you can create by right clicking on a nested event.