phanamanaman's Recent Forum Activity

  • Hello -

    How do I show the number of lives a player has as sprites (like Marios or Pac-Men) instead of a number? In another language I used in the past the correct term was to "replicate".

    Thanks, regards.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads

    Hello. It shouldn’t be battery throttling, as I plug the computer and phone into power outlets when away as well; the only difference in this scenario is the connectivity.

    Hello.

    I use Construct at home and sometimes away while tethering to my phone. When I preview (run) my project using home wifi, it runs smoothly. However, while tethering, it runs choppy.

    Is there something I am doing wrong? My mobile plan has high speed internet. I haven't figured out what could it be yet.

    Mods, if this post should go elsewhere, please move accordingly.

    Thanks, regards.

  • Because I didn't pay attention! Now PlayerBullet.Count works well. Thanks!

  • OK, fixed it! It's a mix of suggestions and first-timing, so forgive my mess:

    In the first image you can see I put in the three conditions: button pressed, the laser count is less than or equal to BulletsOnScreen (set to 4, so you can fire that last laser and get to 5), and the player can shoot (is not locked out).

    In the second image you can see that if there are 5 lasers (greater than 4, the value of BulletsOnScreen) we lock the firing out by setting CanShoot to 0 for 2 seconds, then unlock it by reverting CanShoot to 1.

    In this third image I just leave the movement and destroy after 1 second.

    Now that the concept works, I'll fine tune the times and the laser speed.

    Thanks for the help!

  • So, to clarify - as long as you keep the number of lasers on the screen below 5, you can fire a new laser at any time without any delay. But when there are 5 lasers, the gun becomes unavailable for 2 seconds. Is this correct?

    Hello! That is correct.

    First, you can use PlayerBullet.count expression instead of BulletsOnScreen variable - this way you don't have to worry about updating this variable when a laser is created of destroyed.

    You can also use "Timer "Bullets" is running" condition instead of CanShoot variable.

    There is a mistake in your second event - "BulletsOnScreen>4" condition runs on every tick while it's true, so the timer is restarted again and again.

    I suggest you create a sub-event inside the event where the bullet is spawned. In that sub-event check if the PlayerBullet.count>4, and start the timer.

    I'll try the suggestions above and provide results. Thanks much!

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

phanamanaman's avatar

phanamanaman

Member since 14 Aug, 2022

Twitter
phanamanaman has 1 followers

Trophy Case

  • 2-Year Club
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

6/44
How to earn trophies