ramones's Forum Posts

  • When you create an object from a family it creates a random one so half the time it's creating RingTop on the bottom layer.

    Change the 'Create object' event to spawn a RingBottom on layer 1 (or a RingTop on layer 3).

  • Yes pathfinding has a stop action and then you can call 'move along path' again to continue on.

  • The timer is affected by timescale as is the time expression. Try printing out wallclocktime.

  • I hate that Windows folder browsing dialog as well but you can set the default export folder in preferences at least.

  • The problem is that you're doing that every tick. On tick 1 it destroys two sprites. On tick 2 it destroys two more... etc. You need to add a condition to make that event only run one time.

  • I've added an array called skills with an instance variable heroName to store all of the heroes skills for the skill select screen. I create an instance of the array for each hero and have a function addSkill() that adds a skill to the skills array.

    The function adds a skill name, type and frame number to the end of the array:

    The skills array looks like this:

    Now updating the preview can be reduced down to two events.

    Select the skills array for the current hero, find the index of the skill name in the array, and then call the updatePreview() function with the skill name and frame number from the skills array:

    Setting up the skill name textboxes can be reduced to a loop as well.

    Select the skills array for the active hero, loop through the array selecting the skillName text for each skill, setting its text to the skill name in the array and setting its color based on the skill type in the array.

    In fact this block of events is the same for every hero except for the line that sets the animation frame so I just took that part out and put the whole thing into a function called displaySkills(), to be called whenever you switch heroes.

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

  • Try Construct 3

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

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