Nimtrix's Forum Posts

  • Did you check out ramones' example? To me it sounds like it does everything you want except store the total time elapsed in milliseconds, is that correct?

    If it is correct, just make another variable "t" like you have in your case, and instead of the "Set text to timer*1000" action in ramones' example, do "Set t to timer*1000". Now the "t" variable will hold the total amount of time elapsed in milliseconds, and the text will show the time in "min:sec:mill" with 2, 2 and 3 numbers respectively.

  • Try mirroring the arm instead of flipping. If that doesn't fix it, maybe you could upload a .capx to a filehost like dropbox so we can have a look? Or explain how your player's animation is set up. Does it mirror, or do you use two different animations for left/right?

    About the frames, it's generally better to keep things within one object if you can. Like having the weapons in different animations/frames instead of using lots of sprite objects.

  • JavaScript's access to the file system on the client side is restricted for security reasons. Apparently you can disable this security manually in the browser, but I'd say that's generally not a good idea, and would obviously only work on your system.

    If you want to try though:

    In Chrome you can run the executable with "--disabled-web-security" or "?allow-file-access-from-files" as a commandline argument, Firefox can disable it within it's about:config.

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

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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.