dop2000's Forum Posts

  • Set X to

    slid_line.X+unlerp(slid_line.minVal,slid_line.maxVal, Value0 )*slid_line.Width

    And, of course you need to pick each slide bar and use different variables in the formula - Value0, Value1 etc.

  • Try adding debug output ("Browser->Log") to these events, to make sure they are triggered at the right moment.

    If they are triggered, then maybe your rolling animation gets overridden by a different animation - idle, walking, running etc.

  • Move second condition where you comparing a variable to a sub-event and use Else:

    On tap gesture on btn
    
        System avatarPicked=3  -> .........
        
        Else
        System avatarPicked=4  -> .........
    
        Else
        System avatarPicked=13  -> .........
    [/code:3qkv17ti]
    
    Or you can actually compress all this code into a single expression using [url=https://en.wikipedia.org/wiki/%3F:]ternary operator[/url]:
    avatarPicked= (avatarPicked=3 ? 4 : avatarPicked=4 ? 13 : avatarPicked=14 ? 21 : 0)
    avatars Set animation frame to (avatarPicked)
  • So you have something like this:

    Enemy2 spawn Enemy1

    Enemy2 destroy

    Add another action before destroying Enemy2:

    Enemy1 set Bullet angle of motion to (Enemy2.Bullet.AngleOfMotion)

  • Instance variable is the easiest way to do it. You can also try something like this:

    build a string with UIDs of all picked instances in the first function and pass it as a parameter to the second function.

    Make sure to separate UIDs with some character, say "#".

    In your second function pick the same set of instances using find(function.param(0), "#"& str(Sprite.UID) &"#" )>-1

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Oh, you are using a custom slider bar.

    Just calculate the position of slid_btn using the Unlerp() function, same as you do in "TextBox->On Text Changed" event.

  • worm1

    To open a capx saved in newer version, rename it to zip, unpack to a folder, open .caproj file in Notepad and edit this line:

    <saved-with-version>24700</saved-with-version>

  • Try Mouse.X(layer) and Mouse.Y(layer)

    Return the position of the mouse cursor in game co-ordinates, with scrolling, scaling and rotation taken in to account for the given layer. The layer can be identified either by a string of its name or its zero-based index

    See also this post:

  • Save the values in global viariables. Set slider value to the global variable on start of the layout.

    Have you tried it?

  • Wow. Do you really need to have 350 objects with enabled physics, all at once, on a small mobile screen?

    What kind of game is it?

  • Simply delete your events 4,5 and 6.

    Only if player is alive, new enemy will be spawned.

    That's it. You don't need the code "If not alive, then don't spawn enemies".

    You can add "Player Set player_IsAlive=0" to event #11, although this is not necessary. After player object is destroyed, event #2 will stop working anyway.

    One more thing - when you invert an event, you invert the condition (left part), not the action (right part).

    So your event #6 means:

    Condition -> "NOT every 1 second"

    Action -> "Create new enemy".

    As a result new enemy will be created not on every 1 second, but on every tick, about 60 times per second.

  • No, you can't select by UID like that.

    Sprite(10) is a Sprite instance with IID=10, not UID

    To pick a Sprite with UID=10 you need to use this event:

    Sprite-> Pick by Unique ID =10

  • gameba

    There are not many options -

    1. temporary disable Physics behavior when you don't need collisions

    2. use different objects instead of instances of the same object.

    3. use Chipmunk.

  • Run your game in debug mode (Ctrl-F4), select each health bar sprite, see where they are located before and after you destroy the gun, which one of them gets destroyed etc.

  • I think when you enable/disable physics collisions, this affects all instances of both objects. You can't enable/disable collisions for specific instances.