Yann's Forum Posts

  • maybe on overlap you snap the player to one of the token.

    To select the proper token you can have a tiny sprite detector, or compare Y position of player and rope token.

    To climb the rope, probably a lerp between Y position of two adjacent token

    To swing, apply an impulse on the token your aformentionned detector is on (if there's two, pick one at random :D) on key pressed.

    No sure if all that will work but it's my first ideas

  • dialogStuff.capx

    But next time, please, use dropbox (:

    Damn I've been double ninja'd

  • I think it uses the global time of the game yeah.

    so you would need to use a global Variable timer

    and in your included event sheet

    Gobal number timer = 0
    +System: On start of Layout
      -> System: set timer to 0
    +System: Every tick
      -> System: add dt to timer
    +System: timer >= 5
      -> System: Create Sprite
      -> System: set timer to 0
  • you can compare any expression to any other expression via the 'System: compare two values' yes

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Their might be a mistake in it, not sure that I should start with the velocity or 0... probably 0, so you just have to delete the "set" lines and just keep the foreach hole part and the apply force part.

  • I didn't open your capx but it seems you came up with the same solution as me

    http://www.scirra.com/forum/forum_posts.asp?TID=47845&PID=299944&title=platFormer-jumps-on-vertical-moving-platform#299944

  • sorry forgot to get rid of it

    you can redownload the capx (:

  • Physics says:

    Gravity : G*mass1*mass2/d^2

    That's basically the formula I used in MoonShield (see the demo page)

    So you can put some mass instance variable in the ship and the black holes (never hurts to have too much parameter to tweak (: )

    And then

    Global Variable G=10  //dunno just a constant to tweak
    +System: Every Tick
    local Variable xVector=0
    local Variable yVector=0
      +System: Every Tick
        ->System: set xVector to Ship.Physics.VelocityX
        ->System: set yVector to Ship.Physics.VelocityY
      +System: Foreach Hole
        ->System: add to xVector cos(angle((Ship.X,Ship.Y,Hole.X,Hole.Y))*Ship.mass*Hole.mass/distance(Ship.X,Ship.Y,Hole.X,Hole.Y)^2
        ->System: add to yVector sin(angle((Ship.X,Ship.Y,Hole.X,Hole.Y))*Ship.mass*Hole.mass/distance(Ship.X,Ship.Y,Hole.X,Hole.Y)^2
      +System: Every Tick
        ->Ship: Physics Apply Force : G*xVector,G*yVector

    Should work

  • Try that... You might like it

    fogParticle.capx

  • Did that a while ago for someone else

    avoidBalls.capx

    Might answer your question

    Also note that the ship sprite need a little preparation.

  • Now that there's families, you can put all your fx sprites and stuff like that in a family and do

    System: On start of layout
    [ul]
    	[li]> fxFamily: Destroy
  • You might want to create a new event sheet you could call 'initialization' and put a

    System: on start of Layout
      -> Sprite: set position to (whatyouwantX,whatyouwantY)
      -> any other thing you want to do on start of layout for each layout

    And include this in the event sheet of all the layout you want this to happen.

    And as Kyat would say: here is the manual entry about event sheet inclusion http://www.scirra.com/manual/82/includes

  • By the way, talking of using function to do something they weren't meant to, you can do a :

    cos(angle(0,0,number,0))

    to get the sign of number.

    Basically if the number is positive, the angle is 0 and if it's negative the angle is 180.

    cos(0) = 1

    cos(-180) = -1

    you will have the equivalent of the sign() function in Construct Classic

  • r0j0 posted something like that not long ago

    r0j0_scrolling.capx

    I just changed the color of the borders to black to fake text disparition