Yann's Recent Forum Activity

  • 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

  • You are obviously not using the spritefont plugin

  • 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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

Yann's avatar

Yann

Member since 31 Dec, 2010

Twitter
Yann has 5 followers

Connect with Yann