Yann's Recent Forum Activity

  • or use the choose() function

    Audio: Play choose("bird","duck","cat","tiger") from Sounds (tag "animal")
  • counting.capx

    First... Using "On Frame Changed is weird" I would place the increment directly in the "On Collision event"

    Also, for your bug, you just had to put the animation speed to 0 (when you edit animation you have animation speed in the property panel)

    If you have some speed in your animation, even with one frame you will trigger the "On Frame Changed" on start of layout.

    And I guess you will trigger it twice when switching animation.

    Well... Now it works as you intended I think.

  • show capx (:

    hmmm... Chocapics?

  • Well... You answered your own question :D

    "altering the platform behaviour speed by comparing the current value of the global variable"

    Sounds good to me

  • If we ask mister Physic, he will talk about kinetic energy (Ek)

    Ek = 1/2 *mass*speed^2

    So what you would want to know is what is the Ek applied to an object.

    And based on it's fragility (which could be an instance variable) you could break it or not.

    Well fragility... It could really be just Hit Point. This way you can hit the same object many times until it break.

    Also, the mass would be another instance variable.

    So we just need to know the speed of the first object relatively to the other one.

    Well wait a minute

    obj1 has an Ek1 ->   Energy impact = Ek1+Ek2   <- obj2 has is own Ek2

    well it's true only for a frontal impact.

    So how to evaluate non frontal impact?

    You probably have to project the velocity vector of obj1 onto the velocity vector of obj2

    Yeah I guess it would be like that:

    Sprite1: On Collision with Sprite2
       Local Variable v1X  // Sprite1.Physics.VelocityX (for simplification)
       Local Variable v1Y  // same
       Local Variable v2X  // same
       Local Variable V2Y  // same
       Local Variable v1   // Sprite1 velocity projected to Sprite2 velocity
       Local Variable v2   // Sprite2 velocity
       Local Variable ECollision //Energy generated by the collision
       //Simplification
       -> System: Set v1X to Sprite1.Physics.VelocityX
       -> System: Set v1Y to Sprite1.Physics.VelocityY
       -> System: Set v2X to Sprite2.Physics.VelocityX
       -> System: Set v2Y to Sprite2.Physics.VelocityY
       //we get (more or less) the Magnitude of the vector (v1X,v1Y) projected on v2
       -> System: Set v1 to -cos(angle(0,0,v2X,v2Y)-angle(0,0,v1X,v1Y))*distance(0,0,v1X,v1Y)
       //Magnitude of the vector (v2X,v2Y) (actual speed)
       -> System: Set v2 to distance(0,0,v2X,v2Y)
       //Energy of the collision
       -> System: Set ECollision to 0.5*Sprite1.mass*v1^2 + 0.5*Sprite2.mass*v2^2

    Then you just have to use the value of ECollision as a Damage value. Decreasing HP of your sprites and breaking them if it's too high.

    This calculation should also work if obj2 try to move away from obj1, the damage should be less than if obj1 is immobile.

  • depend what kind of menu. Maybe you can have some sprites pinned to a main one and you put it one screen when you want to show it up, and offscreen when you want to hide it.

    Make some basic drawing, show us what you want. Also it would be cool if you try your hand on c2 directly. There's no better teaching than the trial and error. Also check out related and unrelated tutos... good teaching too.

  • The PIE is a LIE!

  • There's a layoutname system variable

  • nah it's far simpler than that.

    Snapping is a kind of value rounding. For instance if your round off float value, you obtain a snapping to exactly 1 px.

    To achieve the same kind of effect with wider cells you just have to scale down values, round them up and scale them back up.

    That's the idea.

    Mathematically it looks like that :

    System: Every Tick
       -> Sprite: set X to round(mouse.X/cellsize)*cellsize
       -> Sprite: set Y to round(mouse.Y/cellsize)*cellsize[/code:1sjnyoii]
    now you might end up with some offset depending on either:
    1. the position of the pivot point of your sprite
    Or
    2. the starting position or origin of your grid
    
    for the first one you just have to add a position offset to the result
    [code:1sjnyoii]System: Every Tick
       -> Sprite: set X to round(mouse.X/cellsize)*cellsize+Sprite.pivotOffsetX
       -> Sprite: set Y to round(mouse.Y/cellsize)*cellsize+Sprite.pivotOffsetY[/code:1sjnyoii]
    for the second you have to offset the position before calculation and then offset it back (its like a change of origin)
    [code:1sjnyoii]System: Every Tick
       -> Sprite: set X to round((mouse.X-gridOffsetX)/cellsize)*cellsize+gridOffsetX
       -> Sprite: set Y to round((mouse.Y-gridOffsetY)/cellsize)*cellsize+gridOffsetY[/code:1sjnyoii]
    
    I hope I'm not too wrong
  • Well... I'm a 3D modeler in a game company :D... Soooo not my profession but I indeed went to artschool :D

    I'm sure you like the curves and the colors. Of course the design is all mine.

  • Ok I added sound :D

    haha I'm wasting my time on it now :D

    http://dl.dropbox.com/u/23551572/C2-Games/Simon/index.html

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • wrapped that up. Sorry no sound

    Simon.capx

    To answer your question, I believe that what you call a "while loop" in this case, is the game loop. Every tick, all the event are evaluatedYann2012-01-01 15:34:18

Yann's avatar

Yann

Member since 31 Dec, 2010

Twitter
Yann has 5 followers

Connect with Yann