Excal's Forum Posts

  • I think I have to go through each particular instance after the enemies are created and set their fire rates that way, but separating the 'For Each' outside the 'Repeat' loop still causes them to all have the same fire rate because I'm not sure how to set the instance variable only for instances that haven't already been set.

  • Do you mean like this?

    <img src="http://i.imgur.com/BIlWWAa.png" border="0" />

    Sorry, I'm not entirely sure what you mean. I'm still getting the same rate of fire on all of them :/

  • Maybe it's just me, but they all seem to fire at the same rate?

    SpaceGame.capx

  • Ah, this makes sense.

    For purposes of improvement, I think the difference between window size and viewport could be better clarified in the manual because I read through that and was convinced that viewport is not what I wanted to use, but window size instead.

  • I'm not sure how to pick each single instance and then give that specific instance a value. Right now I'm going through each instance and giving every enemy the same value.

    <img src="http://i.imgur.com/GXcItuM.png" border="0" />

  • Switching to layout width instead of window width now makes the wrap behavior work. I wonder if anyone else has had issues with window size and objects spawning off the screen.

  • The way I do it in my space game is every 1.0 seconds instead of 0.5

    I also have the enemy ships turn to face the player independent of the pathfinding, so this gives them a more 'realistic' feel because when the AI is searching for a path, the ships are still turning and firing.

  • vee, I should just hire you to be my personal Construct 2 teacher.

    This still bugs me, because I really shouldn't have to change it to LayoutWidth. WindowWidth should be working, and I'm not sure why it's buggy.

  • I have a variable for my enemy ship called FireRate. However, the issue right now is that every enemy ship fires at the same rate. How do I make it so that the enemy ships fire at different rates, meaning each different instance would have a different value for FireRate?

    I have a For-Each condition, but I'm not sure how to tie it in with UID.

  • How do these work with scaling?

    Sometimes I have enemies spawn off the screen. The enemy spawning code has them spawn at x = either 10 or WindowWidth - 10, and y = either 10 or WindowHeight - 10.

    There is also code that move them to some amount if they are within 50 pixels of the player object, to prevent them from spawning too close to the player. However, this code is not the problem, as I have enemies spawning off the screen (which makes them unkillable) as the player is sitting directly in the middle of the screen.

    In addition, enemy ships have the wrap and destroy-outside-layout properties, neither of which appear to work. In other words, if you activate shields and crash into an enemy, it does not wrap, it just flies off the screen and disappears forever without actually being blown up because the counter tracking the number of enemies left does not decrease.

    Can anyone shed some light on this?

    <img src="http://i.imgur.com/qwrnriP.png" border="0">

    SpaceGame.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Okay, I've modified the function calls so they pass in a parameter containing the asteroid's UID, this way all the asteroids don't explode when only one of them get hit.

    But now I'm having issues where sometimes asteroids you aren't hitting are splitting.

    <img src="http://i.imgur.com/OG3555U.png" border="0">

    ImpulseCollision.capx

  • People and their beta version capx files!

    For the purposes of bug reporting, you have to use the latest beta version, otherwise you cannot submit a bug report because there is a chance it may have been fixed already in a beta release.

    Despite the disclaimer that beta releases are 'betas', the fact that they have fixed numerous bugs since the last stable release means they are probably more 'stable' in terms of non-new features than the latest stable release is!

  • Thanks Vee!

    I actually found out the problem is one line right above where you highlighted. Layer 0 = background layer, not the active game layer! So I changed it and now things are working more normally.

    You are right that I should be passing in the object that is colliding with the asteroid and not just some random object. What I have is currently a result of copy-paste and not much refining yet. I should add a parameter to the function that affects the physics. However, I honestly do not see the physics library having much effect on my game objects. A lot of the in-game physics, such as the 'bounce' that occurs whenever a player ship collides with something, is done manually via CustomMovement because the physics library doesn't seem effective.

    To be frank, there's a lot of weirdness going on that I'm not sure of. For example, the enemy ships have the Wrap behavior, but they don't wrap so I had to include my own wrapping code.

    I've never heard of families in Construct 2, so I'll have to look them up. Right now I've been using groups, but the events sheet is getting really large so anything I can do to cut things down would be appreciated. I've also recently noticed that some of the things I am manually tracking are also automatically tracked from the engine, so I need to redo the events for those things.

  • I decided to move all the asteroid destruction/splitting code in my game to a single function that will be called whenever one of the following occurs:

    • Player ship collides with asteroid
    • Enemy ship collides with asteroid
    • Player bullet collides with asteroid
    • Enemy bullet collides with asteroid

    However, I am now getting a weird issue where the asteroid sometimes splits correctly, and other times does not split at all. I'm not sure if this is a function problem or a rendering problem, because I am also having weird issues where 'invisible asteroids' collide with my ship despite the fact that they never rendered on the screen.

    Here is the function in question:

    <img src="http://i.imgur.com/Rsgx1ly.png" border="0">

    ImpulseCollision.capx

    Can anyone help me out? I'm confused as to why this is happening after I moved my code to a function call. Is it possible for the function to be called multiple times? Say both the player bullet and the enemy bullet hits an asteroid. Previously, the code that is now in the function would have been duplicated as an event chain for the player bullet -> asteroid collision and the enemy bullet -> asteroid collision, but now both collisions will call the same function.

  • OH, that makes sense! Thank you very much haha.

    I didn't realize some conditions could only be applied as a sub condition.

    But now I'm not sure what the best way to set the variable back to zero after it runs for the first time. Any ideas? The wait command causes the flash to wait for 1 second before starting.