bigmetalstaples's Forum Posts

  • 6 posts
  • I've found several posts detailing how to give a player a shotgun, but I'm trying to get an enemy to do it. They have a turret attached to them that is supposed to shoot a spread of three projectiles at the player. It'll shoot a group of three (in the wrong direction) and then it'll shoot one at a time. I'd love some help.

  • So I'm attempting to create a reloading mechanic that will automatically reload one bullet at a time, like a shotgun, that can't exceed it's max of four rounds, and draws from an ammo reserve. So basically, a single-round loading weapon that uses reserve ammo. When I try to get it to reload, it usually gives the player like 48 bullets or something like that. If I can get it to reload without going overdrive like that, I'd also like to know how to program a reserve ammo function so the player doesn't have infinite ammo.

    Here's any code I have related to reloading:

    Ammo Instance variable is set to 4 normally.

    Mouse: Left Button is down

    Soldier: Ammo > 0

    (Subevent)System: Every 0.8 seconds (reload delay)

    System: Create Object Rocket

    Soldier: Subtract 1 from Ammo.

    Text2(HUD Ammo count) Set text to Soldier.Ammo

    System: Soldier.Ammo < 4

    System: Wait 0.8 Seconds (Time between reloading each shot)

    Add 1 to Ammo

    The code above is where the issue seems to happen. It'll run a reload, and the ammo count will go to 48. I'd love to be able to set a limit, as well as getting to reload one at a time.

  • elliot

    The issue is, there is no momentum. I'm trying to do a wall jump section, but the player isn't blasted far enough to hit the other wall and shoot it. It loses its gained speed once it leaves the explosion. Is this due to it's platformer behavior, or something else I'm missing?

  • This did indeed help. Thank you. However, the character doesn't keep the momentum. As soon as it reaches the outer rim of the explosion, it stops moving. Anyway to simulate this as well?

  • Edit: After some further experimenting, I've created an explosion entity using the code:

    Apply Physics impulse distance(Target.x, Target.y, Explosion.x, Explosion.y) / 100 at angle angle(Target.x, Target.y, Explosion.x, Explosion.y) at image point 0.

    This sort of has the effect that I am going for, however it is very slow and weak. It's less of a blast and more of a lame push. My character also drops like a stone the second they aren't being pushed by the explosions. No momentum is preserved. It may require some tweaking to the platformer settings, but in the event that that isn't the case, I'd like to know what more physics commands I need to write.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • So I'm attempting to design a platforming puzzle game where the player utilizes explosive projectiles to extend their jumps, essentially a rocket jump. The main issue is, I'm 3 days new to the engine. How would I go about creating a projectile that will create close-range knockback to the player upon coming into contact with any surface or wall?

  • 6 posts