Lncredible's Forum Posts

  • Hi,

    Firstly check out the manual: scirra.com/manual/134/performance-tips

    and of course: scirra.com/blog/83/optimisa ... -your-time

    If it is a single moment where you are experiencing a lot of "lag" then you might be in luck - start the game in Debug mode and then use the debugging tools to see how many Collision checks, poly checks, are running at the time of your event.

    If you can accurately reproduce the performance problem then you know EXACTLY where it happens. Take a copy of your game then try to fix it step-by-step by adjusting things.

  • Hi,

    Like you stated the "sprite" method is a good one. If you create a health bar sprite with six frames then you can accomplish this easily:

    (0) Red Orange Yellow GreenYellow Green

    (1) Red Orange Yellow GreenYellow black

    (2) Red Orange Yellow black black

    (3) Red Orange black black black

    (4) Red black black black black

    (5) black black black black black (dead)

    Default frame will be (0) and then you can iterate through the remaining frames each time it takes damage or back again when it heals.

    Also, you can create events that start on the following:

    Monster.AnimationFrame = 2

    Start Phase 2

    Monster.AnimationFrrame = 4

    Start Phase 3

    N.b. Just remember to set the Animation speed to 0 for the healthbar, or it will iterate through the steps itself! You want to be in full control of it.

  • Hi,

    So you have suggested that "time" is the reason why the dash would stop, not something like stamina. Perhaps it is best to use a Counter to control this behaviour.

    1) First, add an "instance variable" to the player called MaxDash.

    2) To your existing function "Player_Dash" you could add "Add +1 to MaxDash". Since the function is being called 60 times a second already, giving you smooth movement, you'll find that MaxDash goes up by 60 every second too.

    3) Add a "Condition" to your "Player_Dash" function that changes the code to:

    On Player_Dash

    If Max_Dash <180

    Set speed to 500

    if Max_Dash >= 120

    Set speed to 180

    Simulate movement Right

    This way your function still operates but the player will find that their speed reverts back to 180 after 2 seconds. To reset Max_Dash you should add a line that says On "D" pressed set Max_Dash = 0. So, D being pressed resets it, D being held doesn't.

  • I sent you a private message

    Hello,

    I'm not able to reply until I've earned 500 forum rep! Contact me on FB or Twitter via my profile if you like.

    Cheers

  • Since I know each sprite's combination, is this still the best way?

    It remains best practice to write functions that are capable of checking any number of combinations. Not necessarily because it's best to have that flexibility, but more to do with being concise - one function to handle ALL combinations is good. Creating 9 separate chunks of code to deal with each combination = repetitive.

    The function can also be used, as I said before, be more granular about how you allocate points, or judge failure. If you are having any trouble writing out something similar to my first suggestion I could do a mockup in Construct 2 for you to look at.

  • Hi,

    It depends what you want to achieve. I would say you need to make it visually / mechanically distinct. So, you know the "stamina" part works, but you haven't revealed what is NOT working. I assume you just haven't managed to change the "speed" of your sprite with the platform behaviour. What have you tried? (post a screenshot of your logic)

    I would be tempted to disable player input as soon as the "Boost" happens (triggering a timer) and then speed the player up, remove gravity and deceleration, and then re-enable them afterwards when the timer expires.. Perhaps something like this:

    You will need the "Timer" behaviour on your Player object for this, and a new instance variable of type text called "Boosting", with default value "0".

    Player.Boosting = "0" # Can't be run unless Player.Boosting is set to "0"

    Event - "Q" is pressed

    Set Group Active - "Movement" - disabled. # Disable your player movement group.

    Start Timer for 1 second with tag "boost" # The duration of the boost.

    Set Maximum Speed = 3x your normal speed

    Set Gravity = 0

    Set Deceleration = 0

    Set Player.Boosting = "Left"

    Set Player.Animation = "Cool.Boost.Animation"

    Event - "E" is pressed

    Set Group Active - "Movement" - disabled. # Disable your player movement group.

    Start Timer for 1 second with tag "boost" # The duration of the boost.

    Set Maximum Speed = 3x your normal speed

    Set Gravity = 0

    Set Deceleration = 0

    Set Player.Boosting = "Right"

    Set Player.Animation = "Cool.Boost.Animation"

    Player.Boosting =/= "0" # When Player.Boosting is not "0" it simulates movement left or right.

    Every Tick

    Player.Boosting = "Left"

    Simulate Platform Movement "Left"

    Player.Boosting = "Right"

    Simulate Platform Movement "Right"

    Player.On Timer "Boost"

    Set Group Active - "Movement" - enabled. # Re-enable player's movement group.

    Set Player.Boosting = "0"

    Set Maximum Speed = Default # what it was before the boost!

    Set Gravity = Default

    Set Deceleration = Default

    Set Player.Animation = "Default"

    I can do a mockup if you need it. Let me know if this helps!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi,

    I'm not exactly sure what you are after, but here is a way that you can increase the speed of an object over time using Events. Depending on whether you have chosen one of the pre-build movement modules such as Platform, Bullet, or Pathfinding, you can increment speed upwards using an "every x seconds" event:

    E.g.

    VariableSpeed = 0

    Every X Seconds

    Set VariableSpeed = Object.Bullet.Speed ## Takes the old speed from the object and stores it in the variable VariableSpeed

    Add 1 to VariableSpeed ## Adds 1 to VariableSpeed

    Set Object.Bullet.Speed = VariableSpeed ## Sets the object's new speed to the variable VariableSpeed

    end

  • Hi there. You'd probably want a function that checks all 8 for input every time rather than having "set" combinations. This allows you the flexibility to include any combination you want in future. The Function could be called with 8 parameters which map to your button combination, such as "10001000" in the example below:

    Variable "FailState" = 0

    ## You need a variable to judge whether or not the player has failed to do the correct combination. Any of the combination checks can register a fail which then gets passed to the next function which allocates points.

    "Combination" on collision with "JudgementRow"

    Run Once

    Call function "Judgement" (1,0,0,0,1,0,0,0)

    Function "Judgement"

    param0 = 1

    param1 = 0

    param2 = 0

    param3 = 0

    param4 = 1

    param5 = 0

    param6 = 0

    param7 = 0

    {

    set "FailState" to 0 ## Resetting the variable so the player doesn't inherit the result from last time.

    if function.param(0) = 1

    if button1 is NOT pressed

    set "FailState" to 1 ## The player has failed the combination.

    if function.param(1) = 1

    if button2 is NOT pressed

    set "FailState" to 1 ## The player has failed the combination.

    if function.param(2) = 1

    if button3 is NOT pressed

    set "FailState" to 1 ## The player has failed the combination.

    if function.param(3) = 1

    if button4 is NOT pressed

    set "FailState" to 1 ## The player has failed the combination.

    if function.param(4) = 1

    if button5 is NOT pressed

    set "FailState" to 1 ## The player has failed the combination.

    if function.param(5) = 1

    if button6 is NOT pressed

    set "FailState" to 1 ## The player has failed the combination.

    if function.param(6) = 1

    if button7 is NOT pressed

    set "FailState" to 1 ## The player has failed the combination.

    if function.param(7) = 1

    if button8 is NOT pressed

    set "FailState" to 1 ## The player has failed the combination.

    Call Function Points(FailState) # Passing Failstate to the Points function, which can be used to either subtract or remove points based on your gameplay logic.

    }

    If you wanted to improve this, you might consider the following:

    1) The player has failed the combination completely (all three buttons missed) - they get 0 points.

    2) The player has failed the combination by missing one of the three buttons - they should get SOME points.

    3) The player has passed the combination - they should get all the points.

    If you changed the variable above to "add +1" (instead of "set to 1") for each incorrect check then pass that number to the "Points", you can judge the degree of their success and failure.

  • Hi - when is this happening - in preview mode?

    I would suggest trying another browser, but also trying an old version of you game (do you have some backups?).

  • Hi,

    Perhaps you have an imagepoint issue on your sprite animation. Check which Imagepoint you are spawning your shoulder pads onto just before the "PIN", then check the sprite to see if the imagepoint is where you expect it to be. If most of the pieces of armour are working it sounds like the shoulder-pads are simply misaligned when you pin them.

  • I can get my 50-60 FPS back by simply deleting the tilemaps *

  • Hi all,

    As placeholders I was using Tiled Backgrounds to design the "floors" of my top-down shooter. I have recently re-designed my "floors" using a tilemap object (400px by 320px sliced into 16x16) with no Behaviours. This first tilemap covers the ENTIRE layout as it is functioning as a replacement for the tiled backgrounds. I also have a second tilemap of the same resolution and slice (16x16) on top of the other tilemap, used for detailing (placing items in rooms, for example).

    Now whenever I load my game on Android I've lost about 20FPS. I've tried various troubleshooting guides / best practices with Tilemaps from the forums / help pages, but to no avail.

    My only option seems to be re-creating 5-10 backgrounds, and having many individual sprites, to cover having some basic detail to my levels. Surely it isn't meant to be this way?

  • Hi there,

    I'll try to put this as simply - I am having some issues with Pathfinding, namely, the Complete Regeneration of the Pathfinding map.

    My game - the facts:

    • I have a game with TWO maps, each one is an individual Layout.
    • Both maps are constructed using various "Solid" objects to form a Maze.
    • Map ONE and map TWO have different mazes.
    • All pathfinding is done by DEFAULT to only use SOLID objects as a barriers.

    Here is the sequence of events with the issue in BOLD:

    • Main Menu - Click "Map 1"

    Map 1

    • On Start of Layout -> Regenerate pathfinding map
    • All objects can pathfind around using the expected behaviour, not colliding with any of the solid objects or overlapping them.
    • End of "Map 1" -> Go to Layout "Map 2"

    Map 2

    • On Start of Layout -> Regenerate entire pathfinding map.
    • Objects now proceed to use the pathfinding map from "Map 1"!!! I.e. walking through all the solid objects as if nothing had changed.

    How can I fix this issue?

  • I guess I'll have to manually put in the space adjustments and use the old Spritefont plugin...

  • Hi,

    Although it may not have all the answers it should help you on the way - there is an "Autorunner" tutorial included with Construct 2. You can access it by starting up Construct 2 (without opening your project) and look through the Tutorial section.