phanamanaman's Forum Posts

  • Firstly, we'll interchange the terms "bullets" and "lasers" for the sake of explanation. It's a space game, so please bear with me.

    I want the ship to be able to fire lasers, which can last (currently) 0.5 seconds before destroying themselves if they don't collide with anything.

    Furthermore, I want a maximum number of lasers onscreen (call it a reload), and a "reload" time of 2 seconds if there are 5 lasers onscreen. In other words, if the first of five lasers is destroyed, I could fire another one, but no more than 5 onscreen. And if I fire 5, there is a reload time of 2 seconds.

    If the above wasn't clear enough, another example: I fire four lasers. I can fire 1 more and there are 5 and then there is a 2 second reload time, but if the first lasers is destroyed then I can fire 2, and so on. Fire - bullets on screen increase by 1; destroyed - bullets on screen decrease by 1.

    So this is what I have thus far, but it does not work as intended:

    Any ideas or pointers? Thanks, regards.

  • You do not have permission to view this post

  • You're going to hate me, but I found the problem. Looking at the original image above, I was spawning using an object called Spawner. I should've been using the object "Nebula", which is basically the object from which I want to spawn from all those image points.

    The original code (substituting the object) actually works!

    Nothing beats looking at this stuff early in the morning before work, with a big cup of coffee and after a shower XD

    Thanks for your help!

  • I can make other objects spawn at the image points (for example, spawn a UFO at a corner). It's possibly my loop "syntax".

  • Thanks and sorry for the late reply.

    Concerning your reply, here's a screen capture - it shows the object with the original image point 0 (center), 1 through 4 (corners), and 6 through 10 (various spots left and right). I am stuck on the 1 through 4 loop.

    As for your second sentence, I am not sure I understand how to proceed. Regards!

  • Hello -

    I am building a game based on Asteroids. I'm more than 50% complete, and results aren't bad. Methinks ;)

    As you progress through waves/levels, the game spawns one more large rock than in the previous level (I'll put in a max later on). Now, I would like the rocks to run through a loop that goes through image points - the corners, 1 through 4, and when adding 1 to the image point counter, it goes back to 1. This repeats until the last rock is spawned. For example, seven rocks would spawn at image points 1, 2, 3, 4, 1,2, 3.

    When I run this code, the rocks all spawn at image point 1, the top corner. What I am doing wrong?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thank you - that worked like a charm!

  • Hello -

    How do I spawn an object relative to the size (width, height) and angle of an object that can rotate?

    In layman's terms -

    How do I spawn engine flame at the rear of a ship that can rotate?

    X, Y, Angle? Sin, Cos?

    Thanks, Regards!