Yann's Recent Forum Activity

  • there ya go

    avoidBalls.capx

  • I think I understand what you want to do.

    You want basically pick the soldier that possess the crosshair

    You can do that quite simply like that :

    create two instance variable for the crosshair object:

    • soldierUID type number default 0
    • firing type bolean default false
    Global variable crossDist = 100  // Distance between soldier and crosshair
    System: On start of layout
       -> destroy crosshair
       System: Foreach Soldier
          -> System: create crosshair on layer 0 at cos(soldier.angle)*crossDist,sin(sodlier.angle)*crossDist
          -> crosshair: pin to Soldier
          -> crosshair: set sodlierUID to Soldier.UID
    System: Every tick
       -> crosshair: set firing to false
    crosshair: is overlapping Soldier
       -> crosshair: set firing to true
    crosshair: is firing
    soldier: pick instance with UID crosshair.soldierUID
          -> Sodlier: spawn Bullet
          -> Bullet: set angle to Soldier.angle
  • No no you can't, seriously... falling M&Ms are copyrighted by me over 16 generation =D

    Hehe... Of course you can and glad you ask (:

  • Right! I just read the title of the topic... :D

  • Well what I meant is that, what you describe seems normal. So I guess you're being too enigmatic :D

    And post your capx while you're at it

  • Parsing a complexe JSON string with only c2 string manipulation functions might be a bit overkill.

    JSON itself handle such thing as object, you won't really need in c2.

    (Unless you do complicated stuff inside custom made plugins maybe)

    My advice: use something a bit simpler like CSV, there's even a plugin for that : http://www.scirra.com/forum/plugin-csv_topic46096.html

  • Isn't that great? :D

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I made a little change on mine, deleted 4 collision polygon points, and by making the polygon a bit smaller you have now nice overlapping when leaves are grouped together.

    Still M&Ms though

    fallingLeaves.capx

    But well... falling leaves aren't really weather effects in my opinion.

    What did you have in mind tastyguy ?

  • Just destroy the 'pilotInPlane' Sprite and spawn a new 'PilotOut' sprite with physics.

    Game programming often requires some tricks (:

    In the end that's what the player sees that matters.

  • I think you can use the same trick as what I use with the platform behavior

    set a JumpCap instance variable (the value should be tweaked by trial and error)

    and in event

    Keyboard: [invert] Space is down
    LocalYVelocity < JumpCap
        -> set LocalYVelocity to JumpCap

    Of course, you will have to calculate this LocalYVelocity which is a projection of the world-space velocity to the player object-space (or player-space).

    And then you will have to convert the set LocalYVelocity back to world-space :D (lots of fun isn'it?)

    Well if you look at the last capx I cooked for you you might find some ways

    By the way, it's < JumpCap and JumpCap should be negative. It's the Vertical velocity you want your player to have if you release space and you're still under its value (which means you're still going up in player space). You don't cap to 0 to avoid too sharp transition but to a low negative value.

  • Never used the touch object, but I think you can emulate that by keeping trace of the mouse position, comparing values from one tick to another and then if the velocity is high enough during a certain amount of time, you have successfully swept (:

  • Global variable list = "1|2|3|4|5|"
    Global variable picked = 0
    Mouse: On Left Click
       // pick on item at random
       -> System: set picked to tokenat(list,random(tokencount-1),"|")
       // delete this token from list
       -> System: set list to replace(list,picked&"|","")

    Weishaupt solution is better if you want some items back afterward.

Yann's avatar

Yann

Member since 31 Dec, 2010

Twitter
Yann has 5 followers

Connect with Yann