dop2000's Forum Posts

  • You can do something like this:

    Keyboard "DOWN" key is NOT down -> CarSprite - Simulate Control "Accelerate"

  • Sokoban mechanics is really simple, all you need is a TileMap and a couple of sprites for the player and crates. Plus maybe some movement behavior like MoveTo.

    Programming the logic can be a bit tricky for an inexperienced developer, but it's also not too difficult.

    Left key pressed -> check tile to the left of the player -> if it's free, move the player there.

    If there is a crate -> check tile to the left of the crate -> if it's free, move both the player and the crate.

    etc.

  • Have you tried the Tutorials? Search for "inventory":

    https://www.scirra.com/tutorials/all

    There are also a few examples in the FAQ:

    how-do-i-frequently-asked-questions_t63692

    I don't know if you need the full inventory system, you can just copy the part where items are displayed to the player.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Oh ok, now I understand your issue.

    Try this - remove ScrollTo behavior, set Unbounded scrolling=Yes in layout properties and add this event:

    System -> Every tick

    ........System-Set scroll X to clamp(Player.x, OriginalWindowWidth/2-50, LayoutWidth-OriginalWindowWidth/2+50)

    ........System-Set scroll Y to clamp(Player.y, OriginalWindowHeight/2-30, LayoutHeight-OriginalWindowHeight/2+30)

    Where 30 and 50 is the thickness of your HUD borders.

    This will allow to scroll the layout 30 and 50 pixels beyond the layout size.

    OddConfection You beat me by just 1 minute!

  • Select the event and press C to add another condition.

  • You need to add "System->Trigger once" to your events 14, 16 and 17.

    Otherwise they are triggered every tick and your animation is constantly restarted from the beginning.

  • I should have said "it's not easily done"

    brair_user, why can't you use the collision polygon? If you need it for something else, then you can try this workaround:

    Create an invisible clone of the sprite, Pin it to the main sprite, define correct collision polygon on the clone sprite and use it for collision detection.

  • Not sure I understood your question.

    If you want to compare two coordinates you can create this event:

    Int(pixA.x)=Int(pixB.x)

    Int(pixA.y)=Int(pixB.y)

    System->Trigger once

    Or do you mean you need to detect when two sprite images (not collision polygons) are collided?

    I don't think it's possible.

  • So your layout is bigger than window size? How do you scroll it?

    Usually in games like this you add ScrollTo behavior to your character and set Parallax=0,0 for your HUD layer. And that's it, everything scrolls automatically except for the HUD.

  • You need to pick one member of the family first.

    How do you select which unit to attack with? Do you click it with a mouse or something?

    Then I'm guessing you have an event like this:

    On object PlayerUnitsFamily clicked

    Inside this event the correct member (instance) of the family will be picked and PlayerUnitsFamily.damage will refer to this picked instance.

    There are lots of other ways to pick instances, this is probably the most powerful and important concept in C2.

  • I think the reason why Alextro's example is slow with 120 pieces is not the layers, but the fact that each piece is actually a copy of full-size animation trimmed using blend mode.

    So yeah, this is not a very good method for big puzzles.

  • Where do you define damage amount for each player's unit?

    If you have "damage" instance variable on PlayerFamily and "health" instance variable on EnemyFamily, then it's should be very simple:

    Subtract (PlayerFamily.damage) from EnemyFamily.health

    If this doesn't help, please share your .capx

  • Try Pin behavior - select Mode: Rope or Bar style.

  • "dt" is frame duration and at 60fps it's always approximately 0.016

    That's why your formula always returns the same result.

    You can try this:

    X=lerp(X, -600, 0.5*dt)

  • Try this:

    If random(100)<20 then drop item