tecbug's Forum Posts

  • Is it possible to "code" A star (A*) algorithm in Construct 2?

    I know there is PathFinder behavior, but i'd like to kode it in construct events to show in school that contsruct also can do it (not only programming language).

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It compares only Y axis, and works only if rocket goes right. If it goes down, up, left (or at any other angles) this doesn't work.

    Launch this (i used Your code) and wait o moment: http://tecbug.pl/pub/c2/avoidingballs2/

  • I'd like to do something like this:

    There's many soldiers on the map. They all moves randomly. All of them has its own crosshair (aim). If soldier sees another soldier in his crosshair he shoots.

    There's my pseudo-code for this:

    <font size="2">events:

    • Start of level
    • for every soldier

    Action:

    • create crosshair
    • pin crosshair to soldier

    event:

    • crosshair collides with soldier

    action:

    • soldier fire

    </font>

    But wrong soldier is firing (not shooter-soldier but target-soldier is shooting).

    I think it should be done like this:

    <font size="2">events:

    • Start of level
    • for every soldier

    Action:

    • create crosshair
    • pin crosshair to soldier
    • for that crosshair set this soldier as parent

    event:

    • crosshair collides with soldier

    action:

    • parent soldier fire

    </font>

    Is there any action similar to parenting?

  • I've made simple game prototype: http://tecbug.pl/pub/c2/avoidingballs/

    As you can see, rockets are avoiding red balls.

    But they always turn right. How can i make them to calculate where to turn to avoid balls faster (depending on ball centre and rocket movement vector)?

    I don't kow if it's clear, so there's example:

    If rocket moves right (angle 0) and if it collides with ball, construct should check:

    if ball.y > rocket.y then rocket rotate right

    if ball.y < rocket.y then rocket rotate left

    Problem is that rockets have different angles...

    There's CAP: http://tecbug.pl/pub/c2/avoidingballs.capx

  • Thank you :)

    Great FAQ.

  • Does anybody know that?

  • Is it possible to make level editor (in C2) with option to save level locally on disc or on remote server?

  • also, when I actually finish the bulk of my current work, I'm seriously considering trying my hand at an android runtime for c2 as well, if someone hasn't beat me to it.

    I'll be your happy tester if you want

    (test devices: Samsung Galaxy Tab, HTC Desire and Desire Z)

  • Man I was fixing up my old pool game for the newer versions and got it all working, then installed CCr1 and the balls starting flying in all directions upon starting the game. I could've saved many hairs from being pulled out if I'd known it was a bug ;p

    Same here :/

    Fortunately it's solved now.

  • Great update, thanks.

    What happened with physics? Everything now goes crazy when i start level. Any suggestions how to make it work like in previous version? "Use old units" doesn't seem to work.

  • Thanks. Very helpful site.

  • I thought about that solution. Pity that there's no layer locking action.

    Thanks.

  • How to make string operations on texts in Construct?

    I home this para-code explains what I mean:

    first("exampletext",5) returns "examp"
    last("exampletext",3) returns "ext"
    substring ("exampletext",2,4) returns "ampl"[/code:12wam0yw]
  • I have 2 layers: Objects and Pause.

    While in a game Objects layer is active and Pause layer is inactive. When I pause the game Objects layer is inactive and Pause layer is active (but still both layers are visible).

    I have to do this because my game/app is about placing objects on Objects layer (by mouse-clicking) and pause menu is also controlled by mouse. If I don't lock Objects layer when I try to click button in pause menu I'm also placing an object in Objects layer.

    Davioware, I hope this makes sense to You

  • How to lock specific layer via events?