EzekielRage's Forum Posts

    Okay, and how do i set it up? do i put that in the door sprite? compare X and then this or how does that work?

    I am looking for some advice, please, about the doors in my game.

    It is a sidescroller. The idea is simple: Player walks up to a door, door opens. once player walks away from the door, door closes again.

    i do this with player.x and door.x but here is the thing: it should work from both sides, so i figure i have to use lerp but i have no idea how that works. also, the door must always open fuly and close fully, preferably until it hits a solid tile.

    so the code should be something like

    if door.x is less than player.x+80 then use 8 direction up until you hit a solid tile. then switch on instance variable to "open" and stay there. if player is away more than 80 then close until you hit a solid tile and then switch to instance variable "closed"

    i can do most of that but i have a problem with the range. how exactly do i tell the door that it should only move if player is closer than 80 in both directions, left and right? and only that particular door?

  • THanks! This is EXATLY what I need

    THANKS!

  • My system is similar, really but I don't use lerp. perhaps i should try lerp, whatever that is, as i have read already in some tutorial to use it, not sure what that was though^^

  • I have a big layout and i want to restrict the camera within this layout. So what i do is I have a camera object that follows the player on X (due to the way the game is structured) and that works well.

    so at the oment i have a trigger in my level that, once the camera touches it, stops the camera from following the player. the result is that the player moves within that camera zone that does not move.

    that also works as it should.

    now, sometimes i want the camera to stop at a certain point and then later move again at a certain point. i do that with triggers and that works well BUT there is now a jump in X positions in the camera. and here i figured to avoid that, wouldn't it be possible to tell the camera to automatically stop moving when the edge of a area is reached, kinda like when it stops scrolling once the edge of the layout is reached.

    i am not sure i am explaining this correctly, though. technically speaking, everything works as it should, it's just not pretty, is all.

    so yeah, is there a way to define an area within a layout and bind the camera to that area?

  • Haha yes, we live and learn

    Still glad you all tried to help me with it, glad to see a nice community work so great

  • I finally managed to locate and fi it! And the error was so dumb, so incredibly stupid that I almost feel ashamde :p

    Turns out I had a second player instance on the layout. I dropped it ther accidentally, behind all layers so it was invisible, and that caused the error. I found and deleted it and now everything works as it should.

    Thanks for the help, ideas and al that. Thanks a lot

  • as said if i delete everything the error is not reproducable if i strip everything. it is reproducable if i just disable everything. so either the disable function does not disable everything as it should or something on my system is interfering with the variable in a different way...

    the thing is, by deleting and disabling i got even more confused. i now know that the error occurs when certain cireteria are met, but there is absolutely nothing in said code, consisting of TWO events, that are even remotely related to the issues at hand. as in, i have an issue with a global variablebut if i disable the event that loads a different variable that is not connected to the other in any way with a background music the thing screws me over. weird^^

    Further Testing reveals that he only does this on one layout. If i change NOTHING and simply go to a different layout, everything works as it should.

  • Unfortunately i can't. If I could reproduce it, I would have found the error by now. Every time i copy the part of the code that's needed to a new file the error is gone. but even if i disable everything else in the main project, the error persists.

  • No, only in this one. And it didn't do it from the beginning.

  • Note: Due to NDA, I can't post the capx file. Sorry!

    I try to explain this as good as I can. So I have a game, 2D sindescrolling style. So the idea is it that if you pick up item, you add +1 to said item.

    lets say i pick up one nail, i add +1 to the global variable for the nail. so i should have 1 nail. that always worked for the last few weeks until now. I don't know why, but suddenly, every time i pick up a nail, i get 2. the debog mode tells me that yes, there is one nail instance (so i don't accidentally pick up two) and when i pick it up i get two nails.

    now at first i thought it is a timing issue, that he runs the action twice before destroying the initial obejct, but that is also not the case. so i thought that another variable or object interferes with the global variable, so i togge disabled everything except the functions for the player picking up the nail - same result. then i did a word search for the variable because i figured if there is an interference somewhere i can find it that way - no roblem there, everything is set up the way it was.

    so i have no clue why i have this problem. the thing is, i could easily set picking up said object to 0.5 instead of 1 so i get my 1 nail, so to speak. but that does nto solve the underlying problem and i have no clue what that might be...

    edit: maybe it helps if i tell you that it happens to at least two variables, both are pickup items, butit does not happen to all pickup items. the code for the item drops anditems pickups are the same, just with their corresponding images. one of those images is animated, one isn't so that's also not a factor.

  • Thanks for the info. It would work with only one layout I suppose. so I'll chekc out this plugin thanks^^

  • Rehi,

    so still nobody here who can help me? Because my entire concept is based around this and if this does not work i have a serious problem. I can fake it with having both parts on the same layout but then i would STILL need a split screen....

  • Perfect, many thanks!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • So after searching for a tutorial and the FAQ i finally give up and post here.

    I have a platformer and my character does not move the way i want.

    well he does, until i add in that damned idle animation. i want him to just stand when nothing happens and he does but with falling, jumping walking things got out of hand.

    i attached a capx file for you to chekc out. please ignore the graphics, many are placeholders. as you can see when you move the player things don't work as expected. any help? thanks

    https://www.dropbox.com/s/nyq6bdk3db6etlt/platformgame.capx[/code:1opz72tn]