Nimtrix's Recent Forum Activity

  • Maybe try this fix?

  • Milliseconds is seconds*1000, so your timer that counts seconds needs to be multiplied by 1000, not modulo 1000.

    Set t to timer*1000 (this)

    Set t to timer%1000 (not this)

  • Say for example I just have a random number of milliseconds. 12345678. Is there a formula which will allow me to convert this into minutes, seconds and milliseconds. This way, I only need to save the milliseconds for each level.

    If you have the time in milliseconds:

    t: time in milliseconds

    milliseconds: t % 1000

    seconds: int(t / 1000) % 60

    minutes: int(t / 60000) % 60

  • All the balls will follow when one of the balls are within distance, you need to add a "For each" loop that goes throught the ball instances and checks their distance individually.

  • You can use the same principle I used for the enemy in the other thread by using the bullet behaviour (as PepperedPenguin said). All you need to do is save the touched location in two variables "targetX" and "targetY" on touch, and set the angle of motion towards that position.

    If you rename your animations walk0, walk1, etc.. you can use the same formula I used for the enemy frames to handle the animations & directions in just one event. The formula returns 0-7 depending on angle, so you just set the animation to ' "walk"&formula ' and it will pick walk0-walk7 depending on angle.

    Check out the animations in Yann's example here.

  • Bullet_8Animation.capx (r99)

    There's probably a better, less event-heavy way of doing the animations, I'll look into it.

    Edit: Yup, much better now. Updated the file.

  • Yeah, but you can't compare the sprite's angle like I said above, since that will always be to the right. (since we no longer change it)

    You need to use "System: Is between values" and compare 'Enemy.Bullet.AngleOfMotion'.

  • Hmkay, check your bullet behaviour's properties (select object, then in the panel to the left) and set "Set angle" to "No". Then, instead of setting the angle of the sprites in the event sheet, use "Set bullet angle of motion". Input "angle(Enemy.X, Enemy.Y, Player.X, Player.Y)" as the parameter when prompted.

    Edit: Ok, never mind the above then.

  • Hmm, make sure it's under one of the "For each" loops, so every enemy gets checked individually.

    PS: don't forget do delete the objects linked to the enemy or you'll run into some problems. (arm and anglehelper)

  • You can use any kind of loop, really, but here's an example of the "While" loop:

    WhileLoop.capx (r99)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Oh I see, it's just my standard response to a zip upload. We get a few of those. <img src="smileys/smiley1.gif" border="0" align="middle" /> The .capx is a renamed .zip file, but I've seen them not open correctly on some hosts before, so I know what you mean. Most of us use dropbox so we don't have that problem.

    I think classic is pretty much the same, but I can't really answer that, never used it.

    If you use the bullet behaviour, the object will move forward along it's angle. Then you just set the angle by using the action "Set angle towards position 'Player.X, Player.Y'".

    Edit: Well, I guess you edited your post before I replied, so if anyone's wondering, that's why my post is totally unrelated to the above. <img src="smileys/smiley36.gif" border="0" align="middle" />

    To make him stop, just use the distance expression again, if he's close enough, he stops moving and attacks instead.

  • Use a loop when creating the objects, every time the loop runs, add 1 to a variable "varY" and create an object at random X and 100*varY.

Nimtrix's avatar

Nimtrix

Member since 30 Dec, 2011

None one is following Nimtrix yet!

Trophy Case

  • 12-Year Club
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • RTFM Read the fabulous manual
  • Email Verified

Progress

15/44
How to earn trophies