justifun's Forum Posts

  • You can post a link to a drop box file

    just post it as a text link instead of as a http link

    Does increasing the "within angle" to like 10 fix the issue?

  • There is an action for an animation called "is playing" that allows to you check if a specific animation is playing currently on a sprite.

    You need to set up several "what if" checks to determine when to play what animation.

    eg: on keyboard "left" pressed

    (sub event) if flying right animation is playing -> play "turn left" animation

    (else)

    play left flying animation

    move character to left etc....

    ...

    .

    This way any time your player is flying right and the left button is pressed, it plays a transition that turns him around. (only if he is currently flying right) otherwise, he will just go left.

    same goes for all other situations he might come across

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Very cool.

    It would be nice that each time you change to a new position in the array using the up/down arrows in the set array position section that the value would update automatically (or provide that option).

    Great work!

  • Not sure off the top of the head why your specific animation isnt working, but there's an alternative way to trigger something when an animation finishes.

    You can compare a value to which frame your animation is currently on.

    so you could do "if death animation = frame 10 then"

  • keyboard on "shootbutton" pressed

    (sub event )system (every X seconds) -> create bullet

    you can tweak X seconds to anything you want.

  • So you want to check them all at once?, in that case put your "check" into a for each (ordered) loop.

  • That's a good way to to do it. I would recommend for good clean programming to take out the hardcoded random(11) and random>=8 and change those to variables such as explosionChance and explosionChanceRange.

    The put those variables somewhere like a blank sprite off screen where you can store game wide variables or use global variables. Then you always know where to find those values if you want to tweak them in the future.

  • 1) all you have to do is check for specific conditions and then apply whatever animations etc you want under each condition.

    eg: Add an event that has Keyboard left arrow is pressed, and add a second condition (right click-> add condition) and pick keyboard up arrow is pressed.

    Now those actions will only occur when both keys are pressed. Rotate the wheel's or play a different animation direction or whatever. Do the same for the other possible key combonations you want.

    2)I can't see the capx right now at work, but it sounds like you just want the car to scale depending on what area of the screen its on. Simply add a "system every tick" event, that scales the car based on its Y postion on the layout. You might need to get fancy with the math to make it scale nicely at any height. I suck at math so perhaps someone else can help with that.

    3) use "on layout start" -> set animation to "standing animation"

    ideally put that event at the beginning of all of your other events.

  • In the part where you have Raycast -> on collision with ninja (event 11)

    That's going to trigger all baddies to spawn and throw a ninja star. you need to create a subevent that picks only the instance that was filtered by the raycast, so that only one the specific ninja throws it.

    ill check out the capx when i get home

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

  • 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