ramones's Recent Forum Activity

  • Sure, go for it. I went on to the skills select sheet. To remove all those duplicate actions in the screen shot I posted in my first post I created a function updatePreview(type, frame). It takes the type of skill ("attack", "block", "magic") and the frame number and shows that card:

    Then you can replace each group of 5 actions with a call to the function:

    Still lots of duplication but it's a start. I like to refactor in small chunks, hopefully keeping everything working in between changes.

  • Starting with the Hero Select sheet:

    I added a heroes array to hold the selected heroes. Then when you select a hero you just add them to the end of the array if they're not already in it:

    Removing a hero is just removing the last value from the array:

    I have a function for displaying all the values in the array:

    And at the top of the skills event sheet I set the global party member variables to the array values (just to keep everything else working for now).

  • I've only had a quick look at it but yeah it looks like you could clean things up a lot. Repetition like this can usually be reduced with loops/functions:

    [attachment=0:210k7k3x][/attachment:210k7k3x]

    Also when you have sequential variables like player1, player2, player3, player4,etc it's often better to use an array.

    I'll look it more detail later/tomorrow.

  • Have a look at this:

  • You can set the Player platform VectorY to -Player.Platform.JumpStrength to make the player jump. Then you'd probably need to add some extra conditions to prevent the player spamming it.

  • It doesn't update straight away when you change the text (or on start of layout I guess). You have to wait at least 1 tick.

  • Sorry I thought you asking how that works. To get the fall height in pixels you can store the players y position when they begin falling and then subtract that from the y position when they've landed.

  • You can use one of the "scroll to" actions or behavior to scroll to any part of the layout.

  • Rename maxFallHeight to maxFallSpeed and it might make more sense. VectorY is the speed the player is moving vertically - ie. the speed they're falling at. maxFallHeight keeps track of the highest speed that the player reaches and if that is > 704 then when they land they take damage. Of course you'd want to then set it back to zero before the next fall.

  • You have a number variable instead of text. Also you can store the array as a single JSON string instead of specifying each individual element.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'll try to explain how I would do it...

    You make all the piano keys instances of the same sprite with an instance variable note to store the name of the note.

    Then you have two variables: solution to store the answer and input to store the player input.

    So at the start you set solution to a random sequence of notes.

    solution = "cdecd"

    When the player clicks a key then you add its note value to the input string.

    Say the player clicks the c key:

    input = "c"

    Using the text expressions: len(text) and left(text, count) you compare the input to the solution.

    The length of the input is 1 so you compare it to the first character of the solution.

    Then the player clicks "d". You add that to the input so the input is now "cd" - length 2. Compare to the first two characters of the solution.

    Keep going until the input is the same length as the solution and it matches.

    If at any point the input doesn't match the first n characters of the solution then they have clicked the wrong key.

ramones's avatar

ramones

Member since 17 Apr, 2012

Twitter
ramones has 4 followers

Trophy Case

  • 12-Year Club
  • x4
    Coach One of your tutorials has over 1,000 readers
  • x2
    Educator One of your tutorials has over 10,000 readers
  • Email Verified

Progress

15/44
How to earn trophies