IGDev's Forum Posts

  • Hi, on project i have SpritesA and SpritesB

    SpritesB have own instance variable 'Var'

    Halo of spritesB have this var =1

    You shuld drop spritesA on sprites B with var=1

    when you find all right places to drop game is finished

    can someone help me with this case?

    CAPX fo help

    https://www.dropbox.com/s/mm07s8uc973sf ... .capx?dl=0

  • bump

  • Have several instance variables in your bullet object :

    - TargetAngle - Numeric

    - Shifting - Boolean (False by default)

    // Sets the random value and tells the bullet it needs to shift in that direction

    Event condition Every 1 sec

    - action Set TargetAngle value to random(0,360)

    - action set boolean Shifting to True

    // The bullet is shifting in the target direction

    Event condition Bullet Boolean Shifting is true

    - Action Set Bullet.Bullet.AngleOfMotion to anglelerp(Bullet.Bullet.AngleOfMotion, Bullet.TargetAngle, dt * 4)

    // We check a range where the angle of motion could be to stop the shifting

    Sub event

    condition System compare two values - Bullet.Bullet.AngleOfMotion + 2 < Bullet.TargetAngle

    AND

    condition System Compare two values - Bullet.Bullet.AngleOfMotion - 2 > Bullet.TargetAngle

    - Action - Set Bullet.Angle of motion to Bullet.TargetAngle

    - Action - Set Shifting to False

    you mean something like that?

    https://www.dropbox.com/s/v7al1u6ujtoh9 ... 7.png?dl=0

  • Set a TargetAngle variable instead of the actual angle.

    Then have the bullet rotate towards TargetAngle.

    I thought that will be easy, can you show this in capx?

  • im using bullet behavior

    and every 1 second use expression

    set angle

    int(random(0, 360))

    what i can make to change this angle smoothly because now its skipping between angles

  • i need to understand how expression must use to works with imagepoints other than origin

    second question

    How do i event

    when SpriteA.y is more than spriteB.imagepoint1 do something

    ??

  • How can i set position of SpriteA to position SpriteB but on his image point 1 ?

  • Here's an example of what I had in mind:

    https://www.dropbox.com/s/dszf5pcewxgpv ... .capx?dl=0

    You solve my 80% what i need

    now i nedd something little more advanced

    https://www.dropbox.com/s/bp20nxm5ilmxx ... e.png?dl=0

    When rod is straight we can imgine that is far away but when rod is close should automatically become longer.

    Its possible to make automatically calculation?

    When end of rod is closer of bottom layout > increase lenght?

    and when is furthest lenght should slightly decrease?

  • Simple approach:

    Use an image that is wider on the bottom and thinner on the end.

    Have the origin at the bottom of the rod (thick part) and place the rod's origin in the bottom center of the screen.

    Then simply set the angle towards where you clicked.

    you mean change angle on X plane

    rod should move on x, y, z

    end of rod should be bigger when is near and smaller when is far from human

  • hello, i found 2D game with nice looking rod movement

    how can i make this same?

  • You should start making tilemaps

    your graphics is good

  • IGDev Also in your example it looks like you have a bug where clicking on the same sprite1 will generate additional lines - or is this intended? If you explain the required behaviour I can have a go at patching it up.

    yes line must be created only on sprite1 surface and end on second sprite1

    line should 'connect'

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Here's an example using a function. In the example I call the function at the start and on any mouse click (the mouse click also randomises the widths of the sprites to simulate the sprite widths changing during runtime) but you can call it whenever you need to in your project:

    https://www.dropbox.com/s/zel61966va8ym ... .capx?dl=0

    Hi, i download your example and im wondering how add posibility to count spawned and stretched new sprites.

    https://www.dropbox.com/s/v1au9pauscki7 ... .capx?dl=0

    can you fix the problem?

    i dont know why stretched lines after drop getting smaller

  • Haha, you quoted me, now i cant erase my stupid comments. Here goes :

    Legal maximum for Acurrent = Cmax

    Possible illegal maximum >> Bincome + Acurrent = bigger then Cmax

    Everything bigger then Cmax goes back to Bincome

    So .....

    Local variable temp

    temp = min(Bincome + Acurrent,Cmax)

    Bincome = (Bincome + Acurrent) - temp

    Acurrent = temp

    https://www.dropbox.com/s/yajxehyx8sxre ... .capx?dl=0

    i see now what is missing

    when i calculate first time

    From B 200 goes to A abd 200 stay

    its possible to make this without Textboxes?

    For example when my A is equal to C

    A should be changed to 0

    and i we should have posibility to click again and add rest from B to A variable?

  • No, that is wrong, i suppose Acurrent cant be less than zero too.

    im so confused about this

    can you show this in capx?