keepee's Forum Posts

  • Click the mouse to spawn random sized objects:

    bouyancy

    There are two instance variables for each object

    "bouy"

    Which is like the base bouyancy rating. The higher the value the more it'll float, and if you set it low enough it will sink.

    and "bouyMod" which goes from 0 to 1 depending on how submerged the object is.. 0.1 being only a tiny bit in and 1 being full submerged.

    then the actual Y force is -(sprite.Bouy*sprite.bouymod*sprite.physics.mass)

    Another thing you could add is a way to increase the linear damping when in the water, and to reset it back to normal when it comes out of the water.

    ..also maybe a crash variable.. that reduces the objects speed when it collides with the water.

  • If you make the clock a global object, this means it won't get destroyed on layout changes.

  • whiteheat

    haha yep, i know the feeling..!

  • whiteheat

    random(-50,50) works too.

    spawn object at player.x+random(-50,50), player.y+random(-50,50)

  • Right.. sorry, I should have tested this.

    The error is because after it has waited, it doesn't remember what loopindex it was on at the time.

    also The trigger once just needs to go above the repeat condition.

    To solve the angle problem, I did this instead:

    <img src="https://dl.dropbox.com/u/53374990/Forum/01.png" border="0" />

    the angle is set by an instance variable that gets added to on each shot.

  • Events don't ever affect objects that aren't in the layout..

    Because they aren't there :p

    Or do you mean if they're on screen? Because in that case it should still apply to them.

    What were you hoping to do?

  • It might have been because of how you returned the movement angle..

    doing it the ways I mentioned above means that up is returned as -90, (not 270).. it was probably the same for the way you originally set it up.

    anglediff works regardless of whether you put in -90 or 270 or even something like -1000..

    I think it's the same for other angle related expressions/actions like anglelerp and 'is clockwise from' for example.

  • You'll want to search the manual entries for loops!

    It'll explain what you need a lot better than me.

    but for example, your events could also be done like this:

    +Repeat 7 times

         ->System     |wait loopindex*0.05 seconds

         ->Enemy2      |Spawn EnemyBullet on layer1

         ->EnemyBullet      |Set angle to 180-(loopindex*10)

    edit: but you'll need to make sure this repeat event isn't run every single tick, otherwise you'll have thousands of bullets.. putting a "trigger once" condition above "repeat.." may be okay.

  • It shouldn't be too hard if you want it to simply trace the players footsteps

    add global variables, something like "lastGridX" and "lastGridY"

    and in the events:

    when a condition for moving the player to a new grid space is met,

    set LastGridX/Y to it's current position, *before* moving the player to it's new space.

    and then set the followers position to the grid space in the LastGridX/Y

    There may be a simpler way though, if your game is turn-based for example you can, on the start of a turn just set the followers position to the players position before moving the player to his new spot.

  • Hi, sorry but If you upload your .capx file somewhere, I'll see if I can modify it and repost.

    It'll be a lot easier to see what exactly the problem involves!

  • First off what's the 'angletracker' actually doing? What's sprite9?

    there might be a better way of finding the angle of movement.

    (I'll just use the player/enemy object name: 'Body' cos it's what I'm used to)

    for example with platform behaviour you can just use:

    Body.Platform.MovingAngle

    and for a physics object you can use:

    angle(0,0,Body.Physics.VelocityX,Body.Physics.VelocityY)

    I haven't downloaded your cap because of the additional plugins, but also, you could try using 'anglediff' inside compare two values.. instead of 'is between values'. I find this generally works out any kinks with comparing angles

    for example:

    +For each Body

       +system, compare two values: anglediff(Body.angletracker,0) is less than 45

          ->set animation... etc

       +system, compare two values: anglediff(Body.angletracker,180) is less than 45

          ->set animation... etc

    as you've probably guessed, this checks to see if the movement angle is within 45 degrees of 0, or if it's within 45 degrees of angle 180

    -180 is Left, -90 is Up, 0 is Right, +90 is Down, and +180 is left again.

    If you want to use 8 directions, then just use the angles inbetween and 'is within 22.5 degrees of x' instead

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • updated my version

    It uses an array now:

    You can copy and paste the Questions and Answers from a spreadsheet like this:

    Pic!

    works with any number of answers now for each question, as long as the array is set to the right size.

    capx!

  • It is that easy, it's how I'm doing the character animations in the game i'm working on.. Although I've only animated two so far, but it's pretty robust and I'd be surprised if I run into any problems down the line while adding more.

    It may take a long time to put all the animations into one object but it'll be worth it for the cleaner event sheet at the end.

    just my suggestion :p

  • You must have missed something..

    It won't keep adding if it gets reset back to 0 at the start of each tick.

  • Use the for each (ordered) condition to pick the lowest

    +For each Sprite, order by sprite.Y descending

         -> Stop loop

         -> ScrollY to lerp(scrolly,Sprite.y, dt*Speed)