InadequateChris's Forum Posts

  • Hi all.

    I have a 2D platformer with two movement speeds - walk and run. Walk is 300 max speed, run is 600 max speed.

    The player holds L to run.

    I'm using the code below. The problem is that as soon as they stop running (letting go of L), they immediately drop to the walking speed of 300, and it's a jarring difference.

    How might I make the speed drop from 600 to 300 over the course of a second, rather than immediately please?

    Tagged:

  • Looks like I need to do some reading up on Dictionaries. Thanks so much!

  • Hi dop2000,

    Thanks for the response but I'm not sure I was really being clear on what I was after.

    I have a set of enemy types and have a method that determines which one the player is up against. That is stored in the variable currentEnemyType. Eg:

    var: currentEnemyType ...Goon ...Brute ...Mage ...Boss ...etc

    What I'm trying to do is get the type of enemy inserted in to the name of an instance variable on the player sprite. Taking Goon as an example:

    Player.attackGoonOneLand

    And against a Brute it would say:

    Player.attackBruteOneLand

    So I'm trying to insert the variable of currentEnemyType in to that instance variable:

    Player.attack**currentEnemyType**OneLand

    But I'm just not sure what to replace those asterisks with.

    Dunno if this makes a difference, but the instance variable is a Number.

  • Hello!

    I've managed to bring a variable in to a string using the & symbol, but how do I do the same for a numeric instance variable?

    I took a wild guess with Hero.guardAttack&currentEnemyType&OneLand but I have no clue how to do this properly.

  • Worked a treat, thanks so much El Constructorr!

    And thanks for helping too newt :)

  • Does anyone know what the best method is to scroll the screen along by its own width, using acceleration and deceleration?

    I've tried lerp but that only produces the effect of deceleration, of course.

    Tagged:

  • I've been playing around with it, and it seems to work when I specify Goon in the action, instead of the Enemy family. Does anyone know why using the family doesn't work here please?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for that Klabundee.

    I just tried it and the variables show up fine, until the new instance is spawned - then the numbers all reset to 0 again.

    With your method of using a dummy layout, do I run the risk of affecting the dummies every time my Event sheet calls an Enemy?

  • Hi all.

    Just trying to spawn an enemy with some variables being applied to its Instance Variables. The result I'm getting is that they're all coming out as 0 when the enemy spawns, rather than containing these numbers.

    I have a suspicion it's because I don't have the object (Goon) dragged on to the Layout in the editor. But I shouldn't need to if I'm Creating the object in the Events, should I?

    For reference, Goon is a member of the Enemy family.

    Thanks for any help.

  • Okay I've ended up writing this code and it seems to work alright:

    (Worth noting that Ken is a sprite in the Enemy family)

    If anyone has a better way of doing it, please let me know. Thanks!

  • Hi! New to the software, learning the ropes.

    In this code I've set the Enemy to Punch if the attackOdds are less than 5.

    However, I'd like this number to be different for each type of Enemy, so I want to avoid hard-coding that 5 and use an expression instead.

    The problem is that the Condition of the Enemy only allows me to select Family Instance Variables.

    Does anyone know the best practice for this please?

  • You do not have permission to view this post

  • Thanks Lionz :)

  • Checking if an animation is playing is straightforward, but I can't seem to figure out how to check if an animation is not playing. Any help appreciated!

    Tagged:

  • Thanks for the response lionz, I'd just figured it out!

    On the button press I've put Set blockLikelihood to random(1, 100).

    And I've put a condition on the enemy that says blockLikelihood <= 25 and put the block animation in there. Works well!

    Cheers.