dop2000's Forum Posts

  • vubidugil

    Try adding this action:

    Sprite2 set angle to myAngle

    Here is a demo:

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

  • I can't see your images. Try uploading them to some other service - like imgur or postimages.org

  • You need this plugin:

    Click the "demo" link to see how it works.

  • Variable RADIUS=200
    Variable myAngle=0
    
    On every tick
        Add 1 to myAngle 
    
        Sprite set X to (pivotSprite.X+RADIUS*cos(myAngle))
        Sprite set Y to (pivotSprite.Y+RADIUS*sin(myAngle))[/code:3ak5ci55]
  • ClimbProgress=0 when the player starts climbing and ClimbProgress=1 at the top.

    You can add something like 0.01 or 0.005 to this variable when key "W" is down.

  • I tried that too and also see about 30-40% difference in fps between the "Array->Value at" event and "array.at(x,y)".

    Who would have thought!

  • Set unitName="water"

    Set unitQuantity=43

    Set text to "I want " & unitQuantity & " units of " & unitName

    If you load these lines of text from csv, it may be easier to put tags in them and then use replace expression.

    You can mark tags with some rarely used symbol - #$@%& etc.

    For example, CSV file contains this string:

    "I want #quantity# units of #name#"

    And then you do:

    Set text to replace(textFromCSV, "#quantity#", str(unitQuantity))

    Set text to replace(textFromCSV, "#name#", unitName)

  • It's not tricky when you know The Secret Formula <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

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

  • Put this event inside the "Repeat 100000 times" loop, run the project in Debug Mode and see if there is any difference in CPU load and FPS.

  • Count me in.

    What will be the format of this course - text tutorial, youtube videos, Udemi course, paid/free etc.?

  • marceloborghi

    This is quite a bold statement

    A million sprites, with behaviors and events? I'd love to see some examples, and would definitely be interested to know how (if) this could be done.

  • add two instance variables to the sprite: StartX, StartY.

    On Start of the layout set StartX to Sprite.x, set StartY to Sprite.y

    On Drop - if dropped on a wrong spot, set Sprite position to (Sprite.StartX, Sprite.StartY)

  • Sure, you can add other instance variables to that family, say TargetGroup and TargetLayer.

    When family member is tapped, deactivate all popup groups and make all popup layers invisible, then activate only ButtonsFamily.TargetGroup and set ButtonsFamily.TargetLayer visible.

    Or you can create an event that runs every 0.1 seconds for example, checks layers visibility, and activates/deactivates corresponding groups.

    If you have lots of layers/groups, you can name them like PopupGroup1, PopupGroup2, PopupGroup3... PopupLayer1, PopupLayer2, PopupLayer3..

    and disable them in a loop:

    For "x"=1 to 20 ->

    ... Set group "PopupGroup"&loopindex deactivated

    ... Set layer "PopupGroup"&loopindex invisible

  • 1. This is the right approach. I do the same in my games. Alternatively, you can put events into different groups and deactivate/activate groups. For example, if menu buttons are invisible and should be disabled, deactivate Menu_Events group. When player taps Menu icon, deactivate platform controls and activate Menu_Events group.

    2. You can add another condition "Retry is on layer..":

    On Retry tapped

    and Retry is on layer "GameOverLayer"

    and layer "GameOverLayer" is visible

    On Retry tapped

    and Retry is on layer "PauseLayer"

    and layer "PauseLayer" is visible

    3. I also suggest adding "Wait 0" before making layer visible/invisible.

    Say, you have two buttons (MenuOpen and MenuClose) in the same position on the screen, but on different layers:

    On tapped MenuOpen -> Set layer "Menu" visible

    and layer "Menu" is NOT visible

    On tapped MenuClose

    and layer "Menu" is visible -> Set layer "Menu" invisible

    With events like this, tapping MenuOpen will make layer visible, but then the same tap will be registered in the next event on MenuClose button, and the layer will immediately become invisible again. Adding "Wait 0" before changing layer visibility will fix this problem.

    EDIT: you can actually optimize all these events by adding all clickable objects to a family, create a family instance variable buttonFunction, and make this generic event:

    On tapped ButtonsFamily

    ButtonsFamily is visible

    Layer ButtonsFamily.LayerNumber is visible -> Function call (ButtonsFamily.buttonFunction)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It depends on which effect you want to use.

    You need another sprite as a mask (white circle for example), put both sprites on the same layer (mask should be on top).

    Try applying different effects and/or blend modes to the mask sprite.