PeaTeaSix's Forum Posts

  • I actually don't see any code that states the bullet is destroyed off screen. Just the line that says it will destroy if it hits Enemy01. Do you have it somewhere else not visible in this screenshot?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If you're talking about split screen for multiplayer, there's an official tutorial on that: construct.net/en/tutorials/split-screen-construct-addons-2252

  • For your background: I'm not sure I fully understand what you are trying to achieve. The way I moved my background is by adding in my background image as a tiled background (not a sprite or regular background), and in my case, my background is always scrolling, so I set it to "Set image X offset to Self.ImageOffsetX-120 * dt", which makes it move to the left on its own at a set speed. You can accomplish something similar by tying this logic instead to the inputs to move the player and only move it when the player moves, if that's what you're looking for.

    As for the on-screen UI, you just have to give the things you want to stay locked on the layout the Anchor behavior, and they won't move no matter where you move.

  • Compare Axis is the function I would look at.

    If left Analog X Axis = -100 and left analog y axis = 0 then sprite is whatever frame/s that point it left.

    Repeat seven more times for your eight directions.

    X = 0, Y = 100 (Down)

    X = 0, Y = -100 (Up)

    X = 0, Y = 100 (Right)

    X = 0, Y = -100 (Left)

    X = 100, Y = 100 (Down Right)

    X = 100, Y = -100 (Up Right)

    X = -100, Y = 100 (Down Left)

    X = -100, Y = -100 (Up Left)

    -EDIT- Now that I'm thinking about it, you may want to set these numbers at 1 (or mess with the Comparison), not 100. 100 would mean the sprite wouldn't change unless the stick was all the way pushed. You probably want it to change faster than that.

  • I know this is a pretty archaic feature as we have online leaderboards that can be utilized via a whole host of methods, but there isn't much talk about this that I can find. Some of the answers I did find were using older methods/functions that aren't used anymore, so being newer, it was hard for me to follow.

    What I'm attempting to do is create a local leaderboard that will save and slot a score up to ten local high scores if for some reason the player isn't online/doesn't want to integrate with Google Play/Game Center. Once the 11th score is achieved, it will replace the lowest score on the board in favor of that score, and finally, will sort them from highest to lowest.

    Where I've gotten in my research is using a few different plugins to make this happen. I have an array called LocalLeaderbaord, the AJAX function for calling that information, and a LocalLeaderbooard.json where the scores are stored. AJAX requests the .json data, the array loads it from the AJAX call, and then I load that data into a Text box.

    However, when I load the data with "Set text to LocalLeaderboard.At(0,0)" or any set of coordinates there, I end up only loading that one cell. That's exactly what it's supposed to do, but it seems really redundant to create 33 text boxes that house one cell of data at a time. I just wanted to make sure before I put in the effort to do that, there wasn't a better way to call this information so that the full array is showing at any one time.

    If not, totally okay, but I realize my lack of experience could make me do something for an hour when it could have been done in ten minutes. :)

    -EDIT- Well, I got a little MORE data, but not enough yet. Using "Set text to LocalLeaderboard.JoinString(" ")" returns the whole first row, so we're making progress. Now I only have to make 11 boxes, and not 33.

  • I'm really new to Construct 3, so my answer may not be the right one here, but for what it sounds like you're trying to achieve, I think you need to use the angles functions in order to make this work. So if your player's angle of movement is greater than 340 but less than 10 degrees (north-ish), you'd show the sprite that shows him facing upwards. Or some variation of that. Repeat for each angle group until you have the sprite facing the direction the player is expected to be going.

    This is assuming that angles starts with 0 at true north, which I THINK it does, but I don't remember.

  • Just circling back to update you all: I was still having a ton of trouble with saving and loading high scores until I realized it wasn't the code about saving and loading, it was my own dumb fault for setting the global variable to 0 each time the game loaded. So no matter what the backend saved the score as, the player always saw 0. Whoops.

    That being said, the core functionality of my game is done, and I've got navigatable menus (even though they are empty). I commissioned a guy to provide me with a few more assets (he worked on the originals too), so I will continue to code the rest as I wait for those, but I'm ridiculously excited to see this come to life. It may be simple, but I have learned so much already off just this one project. I can't wait to do more.

    Thanks to everyone here for the help!

  • Ah; my globals had been setting static by default, so I was missing that it wasn't checked off for local variables. That worked by the way. It's still not *quite* the result I am looking for with my spawns, but it's a start. I think the spawning is honestly going to take up the majority of my time in figuring out because it needs to start out simplistic at first, and progressively get harder, and I'm not quite sure how to achieve that yet.

    As an update, I have now moved to the paid version, as after the core game (which could have probably made it within 50 events), the rest would not, so now I'm just hammering away adding in things that I want to see in this game. It's shaping up to be quite a starter project in C3, but I'm learning so much. The tree sprite trick was super slick though. You'd never know any other way that it wasn't eight separate sprites for the eight tree formations I have.

  • Weird that I cannot edit. Sorry for the double post, but I attempted to try the code and, well, I think we might have miscalculated here LOL. I'm going to play around a bit and see what I come up with, but thought I'd share what ended up happening because it made me laugh.

    Thanks again!

  • R0J0hound -- It's stuff like this that reminds me how new I am not only to Construct, but just programming games in general. I don't know that I ever would have thought of that on my own, but it's a smart way to approach something like this. Thank you so much!

  • MrClifford -- It was my collision points! The origin and sprite size are uniform throughout, but the collision points that were generated were a mess. I'm going to adjust those and I'm willing to bet that fixes it.

  • I've been trying to keep myself within the bounds of the 50 free events for my first endeavor into Construct 3, but with my collision events, that doesn't seem possible. I know eventually I'll get the license for more games now that I've had a good feel for the platform, but still, I may be doing something wrong here. My collision detection for the player sprite alone is nine events, and I haven't even added in the destroyer events for sprites going off screen (though I suppose I could just wrap that into destroy when off screen). Figured I'd ask here though and see if anyone knows of a cleaner/more simplistic way to handle collision detection where it doesn't chew up all my events.

    I've also got another issue around spawning things in my game. The game is an infinite runner, so the player has no left/right movement, just a jump action, and unfortunately using random(#) to spawn my obstacles isn't working. There are certain points where the spawns are just too far apart for a jump, or at just the right distance apart that they can't execute two jumps in succession fast enough, no matter the timing. What I'm wondering is if there's a way to tell the program of a sweet spot for tree spawning. Like "if last spawn is within x distance, you can trigger, otherwise, wait until it is x distance from spawner to send the next one." Seems complex and unlikely, but I thought I'd ask.

    I suppose I could keep playing with the random numbers and stagger them a bit to get the desired effect, but wanted to ask just in case.

    Thank you!

  • MrClifford -- Much appreciated. As for the collisions, I have a comment to the person above talking about image points but it's still pending for some reason. I checked the sprite of the player and every frame for everything it is doing is 64x64, and the rectangle it runs on is just that: a perfect rectangle. I honestly don't know why it's bumping up and down.

  • MrClifford, no worries at all! Definitely get posting however you can lol.

    I really appreciate the help here and even more, the descriptions of why you did what you did. As a learning person, this helps so much with understanding conceptually, not just copying and pasting the logic. Thank you!

  • Thanks for the advice Some feedback:

    1) All sprites for the player character are 64 x 64, and the origin point for all of them is 32 x 32. Should it be somewhere else?

    2) I mentioned that I am already doing that. :) However, I noticed the issue doesn't seem to happen when I don't have a window behind my test window, so I think it's a bug with how the software works, so this is probably a non-issue.

    3) Thank you! I'll take a look right now.