justifun's Recent Forum Activity

  • Yeah you've got it correct.

    the variable will be objectname.varname

    so for example

    system every tick -> No action

    (sub event) system compare instance variable enemy.numlife <1 --> destroy

    now any time a enemies life = 0 it will get destroyed.

  • On collision -> set bullet speed

    using "set animation" changes which sprite animation is playing, not the speed of the bullet

  • Tweaked the file and emailed it back to you.

    I've added a "sightrange" variable to the TUSK object (this is the range that the enemy will be able to see before attacking.

    then within that range, he will play the attack animation

    you will need to try and figure out how to do damage now to the player. Give it a try and report back if you need any help.

  • First create several different types of platforms you want the player to land on while running.

    next, using the system (every 1 second or something) to spawn new objects.

    Set their X position to just beyond the .x of the layout of the screen so that they will start off screen.

    Next use a system every tick event to move the platforms back in -X towards the player at whatever interval you want (probably a variable that will increase over time to speed up the buildings.

    Then lock the player's jump so that its only up and down and they can't move left and right.

    to separate the platforms so that they get created at a variable distance, set that original random timer you used to spawn the platforms to a setting like random(5) seconds. This way, some will be further apart and some will be closer together. Make sure the maximum distance apart isn't too big for the player to jump though. Also you will probably need to add another variable to that as the speed increases because the gap the player crosses will get bigger and bigger as the speed of the platforms come towards them.

  • right click your event and choose "system" -> "trigger once while true"

    also, right click your event and choose "add sub event"

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Here's a follow up.

    1) Create a instance variable for the enemy called "sightrange" - give it a default value like 20 (in the properties field on the left)

    2) add new event

    type: system

    "every tick"

    for the action choose "enemy sprite" - set value

    Then in the next dialog box pick your variable "sight range"

    Now create a new event

    system - compare instance variable

    pick "sight range"

    and change the expression to "<" (less than)

    and where it says 0 right now, change it to distance(self.x, self.y, player.x, player.y)

    substitute "player" for whatever your called your player sprite.

    Then in the action for this new event put something like "set animation" to "attack"

    or whatever you want your enemy to do when the player is close

    now each time the player gets with whatever "sight range" default value you give it, it will execute those actions

  • Yeah, like whiteclaws said.

    Create an invisible sprite and pin it to your character, and put the scroll to behaviour on that instead.

  • To have the enemy attack from a distance you need use the distance() expresssion

    distance(x1, y1, x2, y2) Calculate distance between to points

    so in your case

    system - every tick - compare distance(player.x, player.y, enemy.x, enemy.y) < 20

    ----do actions

    2)

    For the enemy characters turn off the property "has control" if you are using the platform behavior on it.

  • Its super simple. Just use the "count" feature

    scirra.com/manual/133/common-expressions

    Compare the sprite count to 0 in your case and if so, goto next layout

    System "Every Tick> - Compare Sprite.count is equal to 0

    goto layout 2

  • im curious to this as well.

  • Create a button

    on keyboard pressed "a" -> textfield.text = textfield.text & "a"

justifun's avatar

justifun

Early Adopter

Member since 9 Oct, 2012

Twitter
justifun has 3 followers

Trophy Case

  • 11-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

18/44
How to earn trophies