Miyavi's Forum Posts

  • Got it. So if I want to create a Pausing button, I would have to create a new variable "isPaused", and do the same, am I right?

  • That's great!

    Thanks a lot, to you both!

    So basically, what I'm doing here is getting the first thing I hit, the variable is turned, and it only acts once, right?

  • Hey guys,

    I'm creating a first person shooter, which resembles of Time Crisis, so it's a stationary enviroment in which enemies will come out of obstacles remaining invisible until so.

    Here's the real thing:

    I have set a sprite into the background so that I can catch missed shots, and therefore subtract a bullet from the gun magazine.

    It works Ok, but when I hit on an enemy or on my Reload button, it also detects that I've hit on the background and therefore subtract an extra bullet.

    Is there any way I could avoid this?

    What I'm doing is the following:

    Touch - On enemy touched -> Destroy it, subtract a bullet, etc.

    Touch - On backgroundUsedForMissedShots touched -> subtract a bullet.

    Touch - On ReloadButton touched -> set player.bullets to maxBullets.

    So basically, I only want to run an action depending on where I have touched, but as I've said, if I hit on the Reload button, it counts as if I've shot, as it sets my bullets to 11.

  • Nevermind.. it seems to work now. Maybe it was just bad RNG. :P

  • Well, I implemented that, but don't know why, the random doesn't seems to be working, as it always spawns the same anymation.

  • Hmm..seems pretty neat.

    That's right because you're spawning another object, so it does not have the same properties/variables (lives, points, solid..) as the original one would have, which was my main problem.

    I think this should work, so thanks for that.

    I'll try to implement that in a sec.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hum, got it. I'm currently downloading r96, to look it up.

  • I thought of that, but as every enemy has plenty of code with it, when it dies, and play that animation, something weird will happen, as it will act as if he was actually alive, and reset his animation when I enter/leave his "active zone". (I'm currently working on this with a "dead" variable, as I didn't need it before, as the object would be destroyed when dead.)

  • Hi guys,

    I want to make an enemy, when it dies, destroys itself and spawn another random object, which is going to be his death animation. I'm doing it currently with one death animation, and this is the only way that it comes to my mind that it could be done "easily".

    It has to be a must to destroy the enemy, as if it doesn't my code won't work, as he would respawn and then, he'll be invincible.

    So.. basically, I wanted to create an array, loaded with enemy01 death animations, and when enemy01 dies, it would spawn a random object animation from that array.

    Is this possible to do?

    Would anyone lend me a hand in doing so?

    Thanks in advance,

    Miyavi.

  • Okay, nevermind, I already solved it.

    I have a player variable, which tells me if I'm on earth or in water.

    I set the enemies to chase me just when I'm on earth.

  • Hi guys,

    the problem is the following:

    My main character moves around the map, and when enemies are closer to him, they chase him, however I want to have a sort of "safe zone", in my case, a river in my map.

    Is there anyway I could to to prevent them from coming into that zone, so they stop just in front of it?

    It would be like a solid, which is only solid for some objects, so they collide, and can't move through it.

    I've tried to create a sprite, and when an enemy collides with this sprite, they stop following me, but then, when I'm out of my safe zone, they won't chase me any more.

  • The .capx I posted isn't my actual game develpoment footage.

    It's just a quick example of what I'm trying to achieve.

    In my actual content, there are several layers (5 if I recall correctly), being #4 the one related to the pause screen.

    In this .capx, it happens just the same as in my actual content: It will pop up, but it won't pop out.

    Some enlightment on the subject will be much appreciated.

  • So.. I still haven't been able to solve this.

    Here's a simplified .capx of what I'm trying to do.

    As you see, the orange screen (my pause screen) pops up when I first press ESC, but it won't pop out when I press ESC again.

  • Hum... got it done like this,

    It pauses the game when I press ESC, and the pause screen comes up, but if I press ESC again, the timer would go on, but the pause screen stays.

  • Miyavi

    Might try to use pause plugin.

    I'm using it for pausing the game actually.

    Put the test on juegoPausado in subevents of the "On key pressed" event.

    And for your second test, just put a "Else"

    On ESC key pressed

    ... If JuegoPausado = 1

    ...... Do stuff;

    ... Else

    ...... Do other stuff;

    That's what I needed, I am actually using r84, so I wasn't aware of these new improvements yet.