Scenic Route's Forum Posts

  • Huh, that was indeed the issue. But I have no recollection of making the mouse 1 into a container. Very weird. Oh well, thanks for the heads-up!

  • I'm trying to have 2 different enemies on screen. I'm using EnemyBox to handle the bullet movement, with an animated sprite Mouse pinned for the animations... pretty standard. See the code snippet below.

    EnemyBox1 has Mouse1 pinned, EnemyBox2 has Mouse2 pinned and will have different specs. On the layout I have many instances of EnemyBox1 and EnemyBox2, but only 1 instance each of the mice.

    Here's the weird part. For EVERY EnemyBox1, the game is pinning an instance of Mouse1, so there's a horde of them. For EnemyBox2, only one instance of Mouse2 is getting pinned to EnemyBox2, and the other EnemyBox2's are empty.

    The code above is the ONLY code dealing with pinning the mice. So why are they behaving differently? EnemyBox2 and Mouse2 are both clones of the 1st version, so they have all the exact same parameters. I honestly don't know which is the correct, expected behavior given the code I'm using.

    Any advice would be greatly appreciated.

    Tagged:

  • So I'm working on a game that has a couple of Layers, but the top one is a HUD that I need to have locked in place and scale. From what I've read, it should be as simple as reducing the Layer Scale to 0%. While that DOES lock my HUD in place on screen while the rest of my Layout scales up, it is mysteriously disabling my ScrollTo behavior I have assigned to my Platformer Player. The Layout just zooms to the center of the screen.

    Any ideas what's going wrong here? I have another game I'm tinkering with that's using the same Layout scaling and Platformer + ScrollTo, and it works as expected. It's something to do with that one Layer NOT scaling that's causing an issue.

    Also, the player is NOT on the HUD layer.

  • What I suggested works if you have 'set angle' ticked on the bullet properties, which is the default. If you unticked then it won't work, it will just change the angle of the object and not the angle of motion with it.

    Huh. You're right. I think my problem was that I was spawning an object that was not previously in the layout, and there didn't appear to be any way to "check" that box with just the code (maybe I'm just overlooking it). Without making any changes to my code, I just dragged an instance of the bullet into the layout, and everything started working correctly. Thanks!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yeah I've had zero luck with this also. What lionz recommends sets the angle of the bullet SPRITE, but does not change the angle of motion.

    If you try to change the angle of motion, the script only allows for a single number (angle), and won't let you input Mouse.X and Mouse.Y.

    It seems that spawning a bullet, the bullet will match the angle of the object that spawned it and travel in the direction (that's how it works in the Ghost Hunt tutorial). I've yet to figure out how to take a stationary object and spawn a bullet that flies towards the pointer.

  • Ready to hear the DUMB thing I did? I had the choose X option set to 1100 right?

    My layout is 1024 wide.

    I thought I had it set to 1280. DOH!

    Couple that with a "destroy outside layout" behavior, and yeah, my right-side baddies were nowhere to be found.

    All fixed now, and working exactly as intended.

  • I've set all the variables for Pirate to 0 so that it just shows up and sits still, so I can see what's going on. Every single instance shows up at X 100 (and a random Y between 20 and 300), none at X 1100. This is the only code so far that deals with the Pirate sprite.

  • I beleive what you are looking for is the random function. In your case, random(100-1100).

    Choose only puts it at one of the set values, not a range.

    No, I need it to be at 100 or at 1100 specifically. Nowhere in between.

  • I have a System event that every few seconds creates a sprite on screen. I'm trying to have the X location choose between the left or right side of the screen by having the X coordinate be "choose(100,1100)".

    The code works..... but ALWAYS places the sprite at the 100 location and never the 1100 location.

    Am I using this wrong or what?

    Tagged:

  • Good.

    Grief.

    I have NEVER noticed that stupid arrow before. I didn't know you could nest like that. > INSERT FACEPALM HERE <

    Thanks!

  • I have looked and looked and looked, and for the life of me I CANNOT figure out how the Pacman-esque player is controlled. It basically has one behavior, Bullet, and a handful of variables attached, but I can't find ANYTHING anywhere else in the game that even addresses the Player, other than a life count. Somehow the buttons are affecting the player's bullet behavior, and something is causing the player to slide from one tilespace to the next and stop, but WHERE IS IT??? At my wits end here over a stinkin pacman game.

  • I know this is probably the noob-est of questions, but I'm trying to calculate the relative distance between 2 sprites, and I know the formula is basically:

    distance(sprite1.x,sprite1.y,sprite2.x,sprite2.y)

    ....but I haven't figured out where this code goes. I've not been able to find any examples of how it's implemented. If someone could show me an example, I'd be grateful.

  • So "on screen" specifically refers to being visible in the viewport..? That's where I was mistaken then, I was treating "not on screen" the same as not existing in the layout at all. Thanks for clearing that up.

    I figured out another way around it that doesn't even need a timer, just using the wait command for a random # of seconds instead, and that's working as expected.

  • I have what I thought was a pretty straight forward blip of code that simply will not work, and for the life of me I can't figure out why.

    As you can see, the Web will randomly spawn a Spider at it's center every 5-10 seconds. I only want 1 Spider on screen at a time, so I've added a condition that, if the timer goes off, AND Spider is not already on-screen, THEN spawn a Spider.

    The code as pictured never spawns a Spider.

    If I simply remove the "X is on-screen", the web correctly spawns a Spider every so many seconds.

    I know for a fact there are no Spiders already on screen. Can anyone tell me WHY this won't work?

  • OMG that was it! I tried the container already, but I mistakenly added extra enemy sprites as well and it went haywire... I didn't realize the container would AUTOMATICALLY create the sprite when I placed a new Box! Thanks so much!