Yann's Forum Posts

  • Yeah since you can put any expression in the field it's not really "parseable".

    For instance I often do a:

    -> go to layout "Level_"&str(int(replace(layouName,"Level_",""))+1)

    to go to my next level when I name them "Level_1","Level_2","Level_3" etc.

    I don't think c2 should/could parse this thing :D

    (Yeah I wish there were a "go to next layout" I could use more meaning full titles for my levels \o/)

  • Ashely

    Yeah I thought it was something like that. "The nex top level event" it's indeed very problematic for pseudo-random generation algorithms or any recursive stuff.

    Ideally, we should be able to pick and do overlap and parameter checks as soon as an object is created in the flow of actions.

    Hope you'll manage to work your magic on that (:

  • Hi, I wonder if it's by design or not, but I think that it's highly unexcpected.

    This capx just shows the problem in a simple way, but I stumbled upon this bug while working on a bsp tree algo.

    Basically I create 2 new sprites from existing ones each loop iteration. And only the first iteration works.

    So work around it I had to use the game loop instead to access an updated object list each iteration.

    If you're curious you end up with something like for now that.

    I think I read somewhere that objects are only created at the end of the event block containing the create action.

    But I think in loops cases it's too limiting.

  • Set Mask to blend mode normal

    Put Texture on top in the same layer

    Set Texture to source-in

    Only the orange inside the circle will appear.

    The only issue with that technic is that you will see the black circle when it's out of the orange texture.

    The solution I came up with was to create a shader that set pure black pixels to transparent and apply it to the layer. If there's pure black in your the texture you want to in place of the orange, you should just set them to 1% instead of 0% grayscale.

    capx

    Black To Alpha fx

  • They would have to draw all the animations?

  • Nah there's no plugin to handle 3D effects for now.

    Unless R0J0 finds a magic way, I'd say you're better off learning a bit of Unity.

    It would just be a matter of applying their platformer tutorial, but rebinding the controls and tweaking the camera so it follows the character on an axis.

  • my version is the last stable release, you should pick it up (:

    http://www.scirra.com/construct2/releases/r103.2

  • quick and dirty way platformFollower.capx

  • Try Construct 3

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

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

    you can also do it like that

    scrollingStyles.capx

  • as described in the post just before

    you create an instance variable named 'name' for slid_line

    and you set the value of 'name' for your volume slid_line object to "volume"

    +slid_line: name = "volume"
      -> Audio: set "your tag" volume to slid_line.value
  • if your enemy always go left you can do something like:

    You set the maximum speed to 800 or higher in properties

    Bullet: On collision with enemy
      -> enemy: Set Platform vector X to 800
    Every tick
      -> enemy: Simulate Platform pressing Left
      -> enemy: Set Platform vector X to clamp(self.platform.vectorX,-15,800)

    (setting the vector X to something greater than 800 is useless since you'll just be clamped to maximum speed)

  • that? LoS.capx

  • Oh right, I think the jittering is caused by the fact that when you set angles to a negative value, c2 converts it to a 0-360 range.

    so, as soon as you rotate counter clockwise past 0 degree it will go to 360 then it's clamped to 15...

    So basically you have a sequence of values like that (if isMirrored is true and you have a steady 60fps which gives you a 1/60=0.017 for the value of dt) :

    frame 1: 0

    frame 2: clamp(0-120*0.017,-15,15) = -2.04

    -> converted to 357.96

    frame 3: clamp(357.96 - 2.04,-15,15) = 15

    ... ... ...

    and it will go back to 0 as long as you're jumping

    So yeah using your RotateTo variable is a good idea (:

    And for the dt... Basically to understand how things work, look at how the values evolve when using it.

    dt is the time between the previous and the current frame.

    in a 60fps game,

    <font face="Courier New, Courier, mono">dt = 1/fps = 1/60 = 0.01666666666</font>

    (dt is the "second per frame" so spf = 1/fps :D )

    let's simplify to 0.017

    If you add dt to a value every frame:

    <font face="Courier New, Courier, mono">0.017+0.017+0.017+..... </font>

    After exactly one second, which is 60 frames, the value will be equal to

    <font face="Courier New, Courier, mono">60*1/60 = 1</font>

    in a 30 fps game, after one second, which is 30 frames, you'll get

    <font face="Courier New, Courier, mono">30*1/30 = 1</font>

    So basically, in whatever fps you are, the succession of addition will all reach 1 after one second.

    if you add 5*dt, the value will reach 5 after one second

    so basically, if you

    <font face="Courier New, Courier, mono">set X to self.X + 5*dt </font>

    you add 5px to X every one second, so you move your object at exactly 5px per second

    It works the same with angle:

    <font face="Courier New, Courier, mono">set angle to self.angle + 5*dt </font>

    will rotate at 5 degree per second.

    that's the holy magic of dt in a nutshell =)