Yann's Recent Forum Activity

  • If you do something like

    ObjectA: On collision with family1
      -> family1: destroy

    The only object that will be destroyed it the object in family1 that collides with ObjectA

    Condition does picking.

  • Well... I took none.

  • What does "Active" means?

  • place, stretch and angle some basic square sprite to surround all your tubes path

    And set them to be invisible

  • You need a parenting system.

    Basically for your 'lvlSprite' (sprite representing the levels), you create 2 instance variable

    'ID' and 'parentID'

    Then at edit time you set each variable logically.

    • 'ID' can be the number of the level (1-based)
    • 'parentID' should be the ID of the level you have to clear to be able to play this one. 0 for the first level. (this system won't support multiple parent, just simple branching)

    And then you'd just have to know which levels are cleared

    (damn bit masking would make all that so much easier... there's a bit plugin by the way... but the concept might seem a lil bit complicated even if it's not. And also custom plugins aren't arcade-compatible)

    Anyway storing cleared level is the hardest part. I would use a global text with the list of cleared levels

    Global text clearedLVL = ":0:"
    Global number lvlID = 0
    System: On start of layout
      -> lock: destroy
      System: foreach lvlSprite
      System: find(":"&lvlSprite.parentID&":") = -1
        -> lvlSprite: spawn lock

    And when you enter a level

    Mouse: on left click on lvlSprite
    [invert]Mouse: is over lock
      -> set lvlID to lvlSprite.ID
      -> go to layout (by name) "level"&lvlID

    And when you clear a level

    On level cleared
      -> set clearedLVL to clearedLVL&":"&lvlID&":"

    This way you'll build a string of level that will look like

    ":0::1::2::5::6:"

    We have that kind of separation to avoid problem with the find() function.

    That's all

  • Sprite: set X to turret.X+cos(turret.angle)*distance(turret.x,turret.y,mouse.x,mouse.y)
    Sprite: set Y to turret.Y+sin(turret.angle)*distance(turret.x,turret.y,mouse.x,mouse.y)
  • klaypigeon >

    When you create a sprite, and you put the bullet behavior on it, in the property panel you have some properties for the behavior, one is "speed".

    If you have only one instance and you set a speed it will be kept as a template for runtime created bullets.

  • Global number t = 0  //evolution of interpolation (from 0 to 1)
    Global number startY = -20 //vertical start position of movement
    Global number enY = 300    //vertical end position of movement
    Global number speed = 100  //average speed in px per second
    System:Every tick
      -> System: set t to min(t+dt*speed/Abs(endY-startY),1)[/code:11ceqqut]
    And then
    For a linear movement you use
    [code:11ceqqut]System: Every tick
      -> Sprite: set Y to lerp(startY,endY,t)[/code:11ceqqut]
    For an eased-out movement you use
    [code:11ceqqut]System: Every tick
      -> Sprite: set Y to lerp(startY,endY,t^2)[/code:11ceqqut]
    For an eased-in movement you use
    [code:11ceqqut]System: Every tick
      -> Sprite: set Y to lerp(startY,endY,t^0.5)[/code:11ceqqut]
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • rename my capx into a .zip and open the caproj file to change the version

    and then revert it back to a .capx.

    I don't use any new stuff that should work.

  • If you don't use the foreach, the distance check will be with the first instance of the Door. So for the second the check will return false and then the text will never appear.

    So yeah you'll need the foreach if you have more than one door even if the associated action is the same.

    You're welcome.

  • There's a plugin for that

  • There's several issues with your capx :

    1/ you can't really know if the event is working, because your text is way out of screen at (70,446) when your character (an then the scrolling) is at about (880,3200). So you need to put your text and text_box in another layer with 0,0 parallaxe

    2/ 10px is too short, your the distance between the hotspot of your character and it's boundaries are already greater than 10px.

    I put < 60 instead

    3/ the system distance() function doesn't do any picking. If you know you'll have only one closed door in all your layout it's ok. But if you want to put more than one, you have to filter each closed door with a foreach and do the distance check afterward.

    Look at the capx. the order of event 23's conditions is important:

    • first filter closed door
    • next take each closed door one by one
    • and then do the distance check on the door the foreach is on

    doorPicking.capx

Yann's avatar

Yann

Member since 31 Dec, 2010

Twitter
Yann has 5 followers

Connect with Yann