brunopalermo's Recent Forum Activity

  • Hey mgsoftwaring!

    You can simulate dice (with any number of sides) using the random() expression.

    From Construct 2 Manual:

    "Random(N) - Returns a random number between 0 and N, not including N. The result includes fractions, so random(3) can return 2.5. Use floor(random(n)) to generate a random whole number up to but not including N, e.g. floor(random(3))* will return either 0, 1 or 2. Random(A, B) can also be used to generate a random number between A and B."

    To simulate 6 sided dice use: floor(random(6)) + 1

    If you need the sum of dice values, I'd suggest you make a function like the one below:

    When you call the function you say how many dice you need to roll and it will roll all dice and return the sum.

    eg. roll(3) to roll 3 dice and get the sum of the results or roll(1000000) to roll one million dice and get the sum of the results.

    Hope this helps. Cheers!

  • Hi, Mhanz!

    It's not quite clear what you're trying to do... Is it a screen-wide bomb, like we see in old plane shooters, the effect you're trying to achieve? Maybe you could share your capx or try to explain a little better what you need... Or maybe show an example from another game of what you're trying to do.

    Cheers.

  • Hey Apollo14!

    Sorry for the delay in returning to you. I'm still waiting on the event organization to set a date, but I believe they intend to record the whole thing and post it already. When that happens, I'll let you know.

    Cheers!

  • 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!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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!
brunopalermo's avatar

brunopalermo

Member since 7 Jun, 2013

Twitter
brunopalermo has 6 followers

Connect with brunopalermo

Trophy Case

  • 11-Year Club
  • Coach One of your tutorials has over 1,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

14/44
How to earn trophies