Yann's Forum Posts

  • You are obviously not using the spritefont plugin

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • When you tackle this kind of problem you have to list what the system has to know and what it can deduce.

    For instance, how the system knows which instance to link which each other instance?

    I mean. if you have 4 dots, there's many ways to link them.

    In your picture it seems an instance will always be linked to the same two others.

    So, how can you tell the system how to link them?

    I think you can use an instance variable named 'order' that will hold maybe the order your object were created

    so you can create lines from the first to the second, etc etc.

  • study this topic

    http://www.scirra.com/forum/doubts-with-animation-by-melee-attack_topic48256.html

    it probably holds the answer of most of your questions

  • Global variable current=-1
    +Mouse: on left click release
      +conveyor: pick by UID current
        ->conveyor: destroy
      +conveyor: is Selected
        ->Sytem: set current to conveyor.UID

    Taking into account that you have a 'selected' boolean or something that carry the meaning of "this is the conveyor belt I was just manipulating" that you will switch to false when you drop the belt.

  • haha inline, inblock, you talk like a css guy.

    Well, I'm not sure how your datas are returned by your php script but you should either return them with "\n" at the end of each line, or with a special character.

    For example if you use "|" you can do

    +Ajax: On "hiscore" completed
      +for "" from 0 to tokencount(Ajax.LastData,"|")
        -> spritefont: append text tokenat(Ajax.LastData,loopindex,"|")
        -> spritefont: append text newline
  • you can use a positive number for all your conveyor belt and for the direction you can do something like:

    (cos(conveyor.angle)=0) ? 0 : conveyor.velocity*abs(cos(conveyor.angle))/cos(conveyor.angle)

    in short, if the angle of the conveyor belt is within ]-90;90[ this formula will returns conveyor.velocity if the angle of the conveyor belt is within ]90;270[ this formula will returns -conveyor.velocity if the angle equal 90 or -90 it returns 0

  • The thing that is hard for this kind of behavior is to detect the conveyor belt. 'Cause when the cube is on it, it doesn't overlap it so you can't really know the nature of the 'ground' your on.

    So I used another Sprite for detection. I pined it to the box and made it slightly bigger so it sticks out of the cube (you can see that if you set the boxColl object to visible in properties)

    When the box detects the conveyor belt, it takes its velocity instance variable and put it in the move instance variable of the box.

    And as soon as the move instance variable isn't equal to 0, bam it moves.

    Oh... Well I don't need the 'move' variable I can directly plug the velocity to the box, you can re download the .capx to see the difference if you want.

    The neat things is that you can have conveyor belts with different speeds

  • What I wrote isn't a condition nor an action. It's an expression. Expression can be used anywhere. This one return the speed of your object, so if you want to compare speed you can use that in System: compare two values or if you want to use speed to calculate damage you can do a System: set damage to distance(0,0,Sprite.Physics.VelocityX,Sprite.Physics.VelocityY)*anyKindOfMultiplier

    So yeah... you do what you want.

  • yeah that's what I said, the "mode" variable will give you the "stay the same part" you refer to.

    You need other variable to build difficulty over waves.

    If you want to pick in a list of monster you have, you will have to have a way to know what monster in what wave. Maybe you can have an instance variable in your different monster that will tell in which wave they belong, or maybe you can have a big array that hold the pattern of each wave.

    But definitely don't use the "mode" variable for other thing than handling phases.

  • Well the meaning of the variable in my example is not the same as the meaning you want to put in it.

    My variable "mode" meant to differenciate phases in cyclic events (I could have called it "phase" instead of mode then)

    You on the contrary want to make something evolve.

    So, along with the mode (or phase if you want to rename it) variable, you need another one which will carry the meaning of "difficulty"

    Then you can, as Kyat suggested, use this variable to increase the time of each wave like

    atkDuration = 30 + 10*difficulty

    30 would be the starting point

    10 would be the increment of each difficulty mode (if you increment it one by one)

  • if you use Physics you can get the speed of an object like that

    distance(0,0,Sprite.Physics.VelocityX,Sprite.Physics.VelocityY)
  • r0j0 did that a while ago.. might answer your question

    r0j0_8dir.capx

  • consolStuff.capx

    doesn't handle text horizontal overflow (might want to add character clamping maybe...)

    but scrolling works nicely

  • The syntaxe I used to write the code above is what I found mimic c2 event sheet the closest.

    +Object: Condition
      ->Object: Action

    I use "+" for condition and "[indentation] ->" for action

    When I indent condition block it means they are nested

    +Object: condition
      +Object: nested condition
        ->Object: action

    The code I posted above is at beginner level (if you except the use of dt which is just a tad more advanced... maybe)

    as dt is the time between two tick of the game, the 'Timer' variable will just count time.

    Anyway, if you don't understand the code above, you need to follow some tutorial and read the manual.