A few questions

This forum is currently in read-only mode.
  • Hi,

    Before I start, I'd like to say that I love Construct so far, it seems great. I'm making a small game to get used to using it, but I'm having a few problems:

    -Firstly, is there a way to change the 'facing' for an object, without rotating the object itself. For instance, I'm making a shooter, and when bullets are spawned they move in the direction of the facing. However, it seems that the facing defaults to the right, and I want them facing up. I worked around it by drawing up all my sprites facing to the right and then rotating them in construct, but I was just wondering if there was an easier way around this that I was missing.

    -Secondly, the wrap behaviour doesn't seem to be working for me. It wraps both vertically and horizontally, even when I only have horizontally ticked. Also, is there a way for me to block moving off the edges at all, instead of wrapping or just going on forever?

    -Lastly, I'm having trouble using the else function. When you destroy a rock, there's a random chance that a powerup will show up. Then, there's a random chance that it will be such-and-such powerup, and then there's a random chance that it will be this powerup, or that one. Or at least, that's what's meant to happen, but I can't get it to work.

    Her's the .cap in case you want to look at it.

    (I changed some variables so that the powerups will appear every time, so that I can test it better)

    http://dl.dropbox.com/u/4649219/SpaceGameTest.cap

  • -Firstly, is there a way to change the 'facing' for an object, without rotating the object itself. For instance, I'm making a shooter, and when bullets are spawned they move in the direction of the facing. However, it seems that the facing defaults to the right, and I want them facing up. I worked around it by drawing up all my sprites facing to the right and then rotating them in construct, but I was just wondering if there was an easier way around this that I was missing.

    Yeah, have the same thing going on here since I'm also sort-of making a vertical shmup - always turning the art 90 degrees counterclockwise is a bummer, but I'm almost used to it. Maybe someone will give a solution, who knows.

    -Secondly, the wrap behaviour doesn't seem to be working for me. It wraps both vertically and horizontally, even when I only have horizontally ticked. Also, is there a way for me to block moving off the edges at all, instead of wrapping or just going on forever?

    At first I thought about the old fashioned way of doing this with an "If Ship.X > PlayAreaWidth" etc, but then realized it's not really necessary, this is easier and faster:

    + System: Always (every tick)
    -> Player: Set X to clamp(Player.X,40,600)[/code:1ierckm0]
    Clamp is a great function - it basically limits the value to whatever you want - in this case it's a minimum of 40 and a maximum of 600 pixels so your ship stops a little before the outer edge. Do the same for Y and you are set.
    
    
    

    -Lastly, I'm having trouble using the else function. When you destroy a rock, there's a random chance that a powerup will show up. Then, there's a random chance that it will be such-and-such powerup, and then there's a random chance that it will be this powerup, or that one. Or at least, that's what's meant to happen, but I can't get it to work.

    I'd say don't try to do this with a lot of ELSEs - try just setting some variable to a random value and then do checks on that.

    I'm being a little vague here to inspire learning, heh, heh

    P.S. Look into using groups in your cap - really helps hold it all together and have a clearer overview of what's going on.

  • Thanks for the reply,

    I can see that the clamp function will be really useful, and it works exactly as I had hoped. As for the else, it seems like that isn't the problem at all. One of the powerups just won't show up, even when I place it directly on the layout. I'll keep looking around, it's probably just something small that I'm missing.

    -Edit-

    I found and fixed the problem, it's not as clean as I'd like, but it works. So that's all of my questions answered, so thanks for the help.

  • So that's all of my questions answered, so thanks for the help.

    Slow your roll there, buddy. We got some things to talk about first.

    -Firstly, is there a way to change the 'facing' for an object, without rotating the object itself. For instance, I'm making a shooter, and when bullets are spawned they move in the direction of the facing. However, it seems that the facing defaults to the right, and I want them facing up. I worked around it by drawing up all my sprites facing to the right and then rotating them in construct, but I was just wondering if there was an easier way around this that I was missing.

    Yeah, have the same thing going on here since I'm also sort-of making a vertical shmup - always turning the art 90 degrees counterclockwise is a bummer, but I'm almost used to it. Maybe someone will give a solution, who knows.

    If you guys mean you want your bullets always facing up then you can draw them facing up and set the Rotation property in the sidebar to "No rotation."

    -Lastly, I'm having trouble using the else function. When you destroy a rock, there's a random chance that a powerup will show up. Then, there's a random chance that it will be such-and-such powerup, and then there's a random chance that it will be this powerup, or that one. Or at least, that's what's meant to happen, but I can't get it to work.

    Okay, first off you don't need a bunch of "0 = 0" events laying around. It's a useless event. All it's doing is basically saying "True" every tick, which is what the Always event does. Get rid of them.

    Next, the reason your blue objects aren't showing up is because you're using Else incorrectly. But more on that in a moment. Let's have a look at a more stable spawning event. This is how you were doing it:

    <img src="http://i48.tinypic.com/2ljmgeg.png">

    You have two separate events checking two separate random numbers. Unless you mean for both powerups to spawn at once on occasion (which I guarantee they were, you just couldn't see them) then you need to roll the dice just once, so to speak. Set yourself up another variable to hold your random and check it in a condition, like so:

    <img src="http://i46.tinypic.com/sb0bat.png">

    Now it will only generate one at a time.

    Now, about that Else. See, even though the blue powerup was being spawned, the way you had your Else set up it was basically being destroyed immediately in the same tick. Else isn't supposed to be used as a sub-event. It's a special event that you place immediately after the event you want to else. Like so:

    <img src="http://i45.tinypic.com/5fitmd.png">

    Notice it makes a little pipe connection to the previous event. That's how you know it's working.

    Also, you can't Else a trigger event like "On collision." Those events happen in just one tick, so saying Else to them is like saying "Every time it's NOT colliding," which kind of defeats the purpose here. Hence the reorganization of the sub-events. Works fine.

  • If you guys mean you want your bullets always facing up then you can draw them facing up and set the Rotation property in the sidebar to "No rotation."

    Ok, I got hired by a shady government agency to create the most unnecessary explanation illustration ever, here's the first attempt:

    <img src="http://i244.photobucket.com/albums/gg36/some9000/SidewaysMovement.png">

    The thing is - the default angle happens to be sideways to the right. It's geometrically correct, it's great for a platformer, BUT... what if your entire game takes place while moving up? Of course you design your sprites for such a viewpoint, you do the design mockups like that, you THINK vertically. Then you insert the graphics and get to do a 90 degree counterclockwise turn for pretty much everything.

    That or design sideways...

    <img src="http://i244.photobucket.com/albums/gg36/some9000/Stupid.png">

    Edit: Yeah, forgot my point somewhere there... it would be AWESOME to be able to set the "world direction" for a given layout (even in 90 degree increments). Would make life so much easier for shmupmakers.

  • Okay you made your point

    Yes, you would still have to set the angle in events to make the bullets fire upward with Bullet behavior. My bad.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Wow, the amount of help on the forums is great.

    That comment about the else was spot on, same about using the random. As for the is 0 = 0, that was intended to run every time, so that I wouldn't have to wonder if the powerups weren't spawning or if I was just unlucky. It was originally is random(9) = 0.

    Regardless, I think I can confidently say that everything's working fine now, so thanks again to both of you.

  • Wow, the amount of help on the forums is great.

    Just be sure to pass it on when you've got more experience .

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)