FaberCastell's Forum Posts

  • Hmm ok let me update this a little.

    Currently I have the enemy ships able to make passes at the player and shooting before getting to the edge of the screen and turning around to repeat the attack. With bullet behaviour this is easy enough to get the direction of movement to be consistent, but am wondering if there is a way to allow the enemy to make a smoother turn. Like 8 direction smoothness applied to a bullet kinda thing.

  • Hey guys, had a search but couldn't find something on the forum so far.

    I have a top down space game. I'm having trouble getting the enemy ships to face the direction of movement.

    Have tried a few methods with bullet and MoveTo behaviours but they're not quite working out, I'm sure there's a simpler technique I am missing.

    Any ideas?

  • Thanks for sharing!

  • Can be done a few ways but here's how I'd go about it.

    Set the enemy spawning events under a group.

    On enemy destroyed, add one to a variable.

    When that variable equals ten, Set group 'enemy spawning' deactivated, create object power up.

    On collision with power up, wait a couple seconds, set group 'enemy spawning' activated. This removes the need for a variable to determine whether or not enemies are spawning.

    Make sure you apply the "trigger once when active" condition so that only one power up spawns.

    Also, I would do a separate event like Powerup - on created -> set bullet speed to random(10,80).

    Is this what you're having trouble with or something I haven't picked up on?

  • OK so after playing around a little I still get a little stuck. I've read and re-read the stuff on arrays, having some difficulty finding an example that works.

    For the sake of understanding , lets say I have two enemy types, two weapon types and their corresponding power (or hit points of damage to be deducted from

    player health on attack).

    On the start of layout I want to spawn either enemy A or B, with weapon A or B, and when they attack the player subtract either value A or B from player health depending

    on what weapon they hold.

    Can someone detail how they would set this up? I feel like I am waiting to read something that helps the whole array thing click for me, it just hasn't happened yet, no matter

    what I attempt in C2 or read in the FAQ sections.

  • Thankyou guys I will investigate XML files, and C-7 your example of using arrays gave me a clearer picture of what I can do.

  • Hey guys! Have consulted these forums many times before and found answers quickly, this time I really need some advice on a couple of things, it may seem long and expansive but I'll try to be concise!

    I am wanting to create a turn based RPG ish (maybe more roguelike) game where you are in a post apoc environment. You can have weapons that increase hit points to enemies, armor that decreases hit points when attacked, and randomized scenery and enemies that you encounter. Nothing too complex graphically just one screen that displays a nice background and the enemy in front of you. When the screen has nothing there, you click to move to another location. At that point a random variable determines what will be next; an enemy, an item to grab etc.

    This is ok for me, I know how to randomize variables and scenery quite easily, the problem I'm having is that to determine if the enemy has a weapon/armor , what weapon/armor the player might have and so forth, I am using a buttload of variables. I feel I am doing it the long way. Based on this premise would anyone out there have an idea for a way to simplify the event sheet? I know I should be using arrays and functions but not as experienced there despite browsing through the forums and tutorials. I can wrap my head around what arrays do but not how to practically implement them for such a game.

    Sorry guys big post. I'm not expecting anyone to solve my problem entirely, just maybe throw some ideas around to better implement those changing variables you get in an RPG like HP, Attack points, item drops, random enemies. Like I said I can do it my way, but I know you guys would have some great input here.

  • That worked perfectly, thankyou! Haven't steered me wrong on these forums yet, extremely helpful. Makes the process so much more enjoyable.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hey again guys.

    I've got a small detail I'm trying to work out.

    When my player has shot an enemy I add one to a global variable, when that global variable = 5 the players weapon changes. Currently set up as

    Global Variable = 5 -> Set Global Variable 'gun' to (x)

    And of course when global variable gun1 = shotgun, 2= rifle etc.

    I can get it to work perfectly if I choose a single number/weapon, but I have a number of random weapons I want it to randomly choose.

    I've tried :

    Global Variable = 5 -> Set Global Variable 'gun' to floor(random(3))

    But am having issues. Sometimes two guns spawns, sometimes it works, sometimes the gun disappears. I'm wondering if there's a simpler way to do this or maybe I am using the wrong expressions to select a global variable.

  • Thankyou man that fixed it straight away, much better!

  • Hey guys, I have a slight problem with a top down shooter and the enemies' bullets.

    If an enemy has spawned on screen their bullets are fine, but if that enemy has been killed and destroyed their bullets suddenly appear to fire from the top left of the screen.

    Each enemy is setup to fire toward the direction of the player. I've tried to fix it with the 'destroy outside layout' behavior applied to each enemy bullet and other simple methods, but I can't get those bullets to stop firing when an enemy hasn't spawned yet.

    edit: basically it seems like before an enemy is set to spawn, they are appearing outside the top left of the layout and shooting toward the player.

  • Thankyou, I will have to give that a try!

  • Hey guys I'm new here, am having some trouble with the correct use of 'for each' and unsure if it is what I am after.

    Basically I have multiple enemies on the screen at once that share behaviour patterns (every random X seconds, jump, idle etc), and although I've used the For Each condition on top of the commands either just one enemy does this or all enemies on screen still jump, run, remain idle at the same moments. Is there a simple work around I am missing? I need the enemies to independently carry out the random commands.