psi_paz's Forum Posts

  • Thank you! I tried to modify it a bit to fit my needs more but I couldn't get it down exactly. It also still has that "smooth camera" effect where once stopping the camera lags behind the players position a bit which i don't like. Like once the player stops moving the camera has to take a second to readjust to the players position, which is a small thing but IMO it really affects the game feel. I realize I explained it pretty badly before that's what I meant. Also this is probably my horrible convoluted code but for the life of me I can't find a way to make the transition between the camera switching sides to be less snappy and slower like in the Mario world one. It can get pretty dizzying if you're going left and right a lot. I also made a few changes to the Y scrolling so that way once you pass a certain point on the screen the camera will auto scroll down a bit.

    I really tried my best to understand the expressions here since my comprehension of expressions as a whole is pretty weak. (I have bad dyscalculia) But I think I was able to understand most of it...?

    Anyway I'm pretty happy with how it's coming along so far! I just need help with ironing out these few things... Thank you!

    Here's the capx: dropbox.com/scl/fi/hlzlw456phs3oseemv95m/CameraMario.c3p

  • To be clear I've been at this for about a day and I just am lost about what to do. For context I'm using a seperate Camera object with scrollto on it. Also This is more of a logic question rather than a "can you code this thing for me lol" question.

    I've been trying to make a Mario world styled camera as the title suggestions, but everything I can think of just doesnt work. For context as to how the Mario World camera works: youtube.com/watch . Also a little more context for what I'm trying to achieve - I DONT want a smooth camera. It's true that I want the camera to adjust itself and move according to the player but I want it to be purely linear movement. Smooth cameras tend to have this sort of slow down and speed up effect when stopping or starting that I find to look pretty bad.

    My first idea was to have the camera object be tweened to a "CameraMoveObject" (the solid white lines in the image attached) once the player collides with a "CameraBorderObject" (the dotted lines). First off this didn't really work as expected... YES it did move to the CameraMoveObject but it would only move to one. Okay. Makes sense. So I tried to Pick by UID and then it just stopped moving to the object completely. Then I tried assigning it a variable and it'd only move to that object if it had that variable. Same thing that happened with UID happened here. At this point I just gave up and made them two seperate objects. Okay cool that works now.

    Now a new problem, I have no idea where to go from there. How would I go about setting the Camera to only follow the player when theyre colliding with the camera move object? How do I make the camera still be at an offset when following the player? Better yet how do I even have each CameraMoveObject/CameraBorderObject follow Mario at a certain distance. (I could probably achieve this by setting a layers parallax to 0, 0 come to think of it but that doesnt seem right either...)

    So does anyone know any Construct actions/conditions/behaviors/ect that help develop a system like this? Sorry for being super vague and not really providing code but I really just don't know how to go about this.

  • In my game I have hitboxes and sprites as separate objects. This *was* working fine for a while but recently had an issue with multiple of the sprite objects be affected by one hitbox object. For example if I have something called enemy1 (note that all of these enemies are in a larger Family called Enemies,) if I change its animation after being damaged then some of (not all of them only some) will change to have that animation. I've been passing their (the sprites) UID through a variable assigned to each hitbox. Though I'm not sure if I'm doing it correctly or even if this is the correct way to go about doing things. (See screenshot for more info.)

    My second question would be.. Is it even worth it to separate Hitboxes and sprites for enemies? Like for a player object it makes sense but for something that has more than one instance is it just better to have one enemy object that contains both animations and hitboxes?

    Also I'm willing to share a c3p file later if needed.

  • Yeah, I was just about to come back and say I noticed that lol

    There were a few other issues I had to iron out (enemies would now stop contact with a wall) but in the end it works now. Thank you both for your help, sorry if I was being annoying about it

  • >

    > Will definitely take a closer look later but this probably won't work for me... just because of the way the image points are positioned on the enemy's hitboxes causes them to teleport when mirrored like that. Though they seem to work fine with the normal Mirror behavior so I dunno might be something else

    You didn’t provide any examples, and now you’re saying there are certain points that destroy the whole algorithm.

    It seems like wasting time—giving answers to people who are too lazy to include their own example of the problem in the question and provide a detailed explanation.

    It wasn't laziness I just didn't have time to test much.

    I just did now, however and yes, I was right about it being the image point. If I center the origin point there's no teleporting shenanigans, however if I keep it as is that's when it starts teleporting. And to be clear as it is currently it's at the top left corner of the sprite so it lines up with my tiles.

    When it's flipping the width it's sending it a tile back/forward because... well you know like I said how the image point is placed. I don't want to move the origin point because it'd mess up other code and make me have to redo level layouts. It's a pretty big hassle. Also the enemies stop when colliding with each other currently because of the way I set everything up but this is something I could fix myself since I know what's causing it (I think so at least). I posted my code above if that'd help at all.

    I don't know why mirroring works fine but flipping the width manually doesn't, unless I'm misreading the code, which I probably am.

    Also I'm confused why you thought I didn't include an example of the problem? I did say it was probably the image point earlier. Unless you mean like a video or something but I don't really think that'd help that much.

  • fex.net/s/p2mabem

    Will definitely take a closer look later but this probably won't work for me... just because of the way the image points are positioned on the enemy's hitboxes causes them to teleport when mirrored like that. Though they seem to work fine with the normal Mirror behavior so I dunno might be something else

  • That's basically what I tried to do, no luck. These are the only events in the project that globally affect the Direction the enemies move in. And the Goomba in particular doesn't have any other code that would affect the their direction outside of these events.

  • To be clear the two objects in question here have the platform behavior. Also I should mention this isn't a singular object but rather a family which contains multiple enemies with the platform behavior. What I *want* to happen is for the enemies to collide with each other and then turn around. (So for example if one enemy was moving to the right they'll start moving to the left and vice versa.) A lot of platformers do this but I've been having trouble doing it myself for the past few months. Usually what happens is instead of both of them turning around only 1 will. I've tried putting them into separate Families or just manually doing x enemy on collision with family "Enemies", nothing works.

    Anyone know a better way to achieve this?

  • You do not have permission to view this post

  • Whats the best way to go about doing an animation system? I think everyone knows how to do basic things like walking and jumping ect. however the problem is when you want to do more things with player animations. For example if you wanted to have a player do a short animation when shooting something for grabbing something. You could do this by adding "if animation 'walking' is not playing" then play "animation shooting" and sure that works sometimes and its what ive always done. however when you want to do more complex things this technique can get really messy. you end up having 10 separate events of "if not walking" "if not jumping" ect and its really hard to keep track of everything. and then eventually events start conflicting with each other.

    You'd have to do some sort of state system but I haven't really found a good way to go about it right now especially when a character preforms 2 actions at the same time. And these are pretty small animation changes that only really appear for a few seconds so I'm not sure if a State Machine would even be worth it in this case.

  • I see, thank you both for the replies!

  • In a lot of Construct 2 projects I see this technique being used. I don't get it at all though. I don't understand how this helps identify the UID of an enemy but it does. What is the parameter here even supposed to be? I don't see a proper parameter. I've been trying to recreate that same thing where a function is only called for individual instances of an object to no avail. I also know that Construct 2 Functions are different from Construct 3 functions so maybe that's apart of it. If someone could please explain what's happening here I'd appreciate it.

  • I tried doing that with "is platform jumping and platform is on floor" and moving it a few pixels to the left or right based on whether or not the slope sprite is mirrored. No dice, though. I also have been trying LOS to detect whether the player is on a slope and then adjusting jump height that way but that wasn't working either. (However, this one just might be due to me not using LOS that much.) So IDK

    Edit: Also I'm not sure if that other bug I talked about where the player can't jump while going down a slope is somehow related to this or something on my end...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Oh, that sucks. Is there no work around for this currently know? I'm going through the github comments and seems like Ashley wasn't able to find a fix. Which would only leave me with the option to get rid of slopes completely. And I *really* don't want to do that since I designed certain things around slopes.

  • (Sorry for the repost - accidentally posted this in the construct 2 forum.)

    I recently just wrapped up my physics engine for my game... Only to realize that the slope physics are completely screwed up. I honestly have no idea why this is happening, I've made multiple platformers in construct and never had this problem. Basically whenever you Jump on a slope that's around this angle, the play character gets stuck in a jumping state even though they should be in their grounded state. Also, this isn't in the video but, sometimes they'll just not jump when at the edge of a slope object? I tested this with both solid square blocks that are rotated and custom slope sprites and they both seem to have the same problem. (See video for more info)

    Edit: i manged to fix both bugs so im posting it here in case anyone runs into the same issue. it was actually pretty simple i was just overthinking it. This might make for some weird edge cases but i havent noticed anything yet and it doesnt seem like it'll matter that much during actual gameplay.

    Also I'm not sure how possible this is but in the future i think it might be a good idea to have an option to disable/enable ledge snapping per solid if possible. I think that'd probably solve the issue of fixing this undoing the work toward preventing ledge snapping while probably also solving this issue. I don't know, though. It may not be worth it conisdering how easy this was to fix