brunopalermo's Forum Posts

  • Hey Pillarist!

    I don't really have the original file, but here's how it would work.

    https://www.dropbox.com/s/d1cd373kf2gdm ... .capx?dl=1

    Hope this helps. Cheers!

  • The problem is that the instance, and, thus, the instance variable, is destroyed. So it ceases to exist BEFORE being increased.

    You don't have to have lots of global variables to do that. Just have two: totalDestroyed, which will be zeroed at the start of every level, to record every time you destroy a ship; and a requiredDestroyed, which will be the amount of ships you need to destroy to finish a level and will be set at the begining of every level to the corresponding target number.

    Hope this helps. Cheers!

  • Hey !

    Here's one way of doing it: https://www.dropbox.com/s/csz19tyt6qndk ... .capx?dl=1

    spawnInterval: the initial delay in seconds between two spawns.

    intervalChangeTimer: the number of seconds before the interval is reduced by 1. In your case it would be 60, but for the example I put 10 so you can see things hapenning faster.

    Hope this helps. Cheers!

  • Hey work3!

    Here's an example...

    https://www.dropbox.com/s/9y5rk2ftjognt ... .capx?dl=1

    Hope this helps. Cheers!

  • Hey mrkaio!

    Big fan of RoboRally here. I already implemented something like it in Construct 2 but I don't have the file here (at work right now). I recommend you use an array for storing "robot actions". Since there is a limited collection of actions, just use an ID for each of them and store them in the array when players do the programming. When you need to execute the actions, check each array position in order and play the corresponding animations.

    If you prefer to use the approach you mentioned, you can easily read the content of a TextBox using the property TextBox.Text.

    Hope this helps. Cheers!

  • Probably because when there's no Touch, Touch.X and Touch.Y default to 0. Try to change the "Every tick" event to a "Is in touch" event.

    Like this: https://www.dropbox.com/s/ml2a6xchupq7p ... .capx?dl=1

    Cheers!

  • Hey Uglypenguin!

    Found out the problem. You have TWO variables called "PlayerStamina", one is a global variable and the other is a instance variable of Player. You are subtracting SprintVal from the instance variable, but is checking the global variable as a condition for the sprint to work. Note that in your picture the condition "PlayerStamina > 0" is shown with a gear beside it (system variable) while the action "Subtract SprintVal from PlayerStamina" has a dragon beside it (instance variable).

    Here's the fixed capx:

    https://www.dropbox.com/s/uii3ve44ggfrm ... .capx?dl=1

    Hope this helps. Cheers!

  • The condition "System | PlayerStamina > SprintVal" means that it will only subtract the SprintVal if theres enough to subtract. If you use "> than 0" PlayerStamina will become -SprintVal. But that's not really important.

    Can you share the capx?

  • You're only setting isSprinting to false when you release the shift key, so, while you have it down isSprinting will be true, no matter how much stamina you have.

    The code should be something like:

    Keyboard | Shift is down             | set isSprinting to True 
    Player   | 8Direction is moving      |
    System   | PlayerStamina > SprintVal |
    
    System   | Else                      | set isSprinting to False
    
    Player   | isSprinting          | Set animation speed to 7.5
                                    | Set 8Direction maximum speed to 375
    
    System   | Else                 | Set animation speed to [whatever the nromal speed is]
                                    | Set 8Direction maximum speed to 250
    
    System   | Every 0.1 seconds    | Subtract SpritVal from PlayerStamina 
    Player   | isSprinting          |
    [/code:hzw7fx4w]
    
    Hope this helps. Cheers!
  • There's a variable on the capx. It controls the speed. Fiddle with its value and check which suits you best...

    Cheers!

  • Yes...

  • Hey Zion!

    Check this capx and see if this is what you need...

    https://www.dropbox.com/s/exq6ntowmaq58 ... .capx?dl=1

    [EDIT] Saw dop2000 answered while I was writing the answer. Anyway, capx is done already. <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    Cheers.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You just copy the folder that contains all plugin files to the plugin folder.

    It's located at [Path to construct 2 folder]\Construct 2\exporters\html5\plugins

    Hope this helps. Cheers!

    I already marked it as duplicate and reported some time ago. A mod will probably fix this soon.

  • Hey Usvatron!

    Since I haven't seen your capx, I'm not sure how you create/destroy the bars. Ideally you should destroy them when the Skull is destroyed. If they're in a container this is done automatically, but, if they're not, just add a Destroy action for both bar elements together with the Destroy action for the enemy.

    What is happening now is that the enemy is dead and your line 99 is setting the bar position to (Skull.X - 20, Skull.Y + 45), since both x and y are 0 (there's no skull), the bar is sent to (-20, 45). The front element is probably there too, but since its width is being set to 0, because Skull.health is also 0, you can't see it.

    Hope this helps. Cheers.