Platforming game help

This forum is currently in read-only mode.
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • G'Day. With my WIP platformer, I have a few problems... Okay, four.

    Here's the cap file.

    This topic has more details on what I'm working on, as well as controls and stuff.

    • Firstly, going between rooms. Each "exit" uses the "Doorside" variable, which switches between 1 and 0, depending on which side of the door the character is supposed to be on. However, going through the first door, which is supposed to change the 0 to a 1, doesn't change it, rendering all the other doors unusable. I'm stumped as to why.
    • The "test" room has a WIP pause menu that works by pressing "P", which drops TimeScale to 0 and makes the menu pop up, and when the button is pressed again, it goes back to normal. When I press P, nothing happens.
    • Julius, the most "complete" character, has a slide move. It works, but his animation quickly goes back to crouching mid-slide.
    • As well, Julius, when he is supposed to attack, only does so when I'm screwing around, jumping and stuff. As for the attack itself, I realise the way the whip spawns isn't very good. Anyone got any suggestions for a better method?
  • Here's what's wrong with the pause:

    <img src="http://i38.tinypic.com/rvf05f.png">

    The first event activates when you hit P, and changes the Pause variable to 1.

    Then it moves on to the next event. Since the Pause variable is now 1, it triggers this event too, which changes Pause to 0. So you're pausing and then immediately unpausing again in the same tick, so you never see it. You need a toggle in there:

    <img src="http://i33.tinypic.com/23vc01z.png">

    The toggle always resets to 0 before it checks your On Key events. When your On Key event is reached, it makes sure that pauseToggle is 0 before performing the action. If it is 0, it will change to 1. That way when it reaches the next event, it won't trigger.

    I'll take a look at the other stuff really quick, but just a heads up I can't seem to play your game. I don't know what's up, but nothing moves.

  • One thing... you have fifteen Start of Layout events in your test layout alone. You only need one. You should really learn to use sub events.

    Edit:

    In fact, I can see a lot of common mistakes in general in your .cap. You have your animated sprites as your Platform objects, and you have them set to Per Pixel collision. This is just going to cause problems for you. You should make a separate, invisible box and use that as your platforming object, and just position your sprites on top of it.

    You don't need to do this for every kind of game, but the way the platform object works you're just going to run into trouble.

    Plus, you would only need one platforming object, and you can use it to put your different character sprites on. If they have to have different speed or jump heights or whatever, you can change those at runtime depending on what character is selected.

  • ... Wow, I hadn't thought of that, that was the same sort of thing that stopped my cutscene from working with just one button press... And sub-events, gotcha.

    Regarding the platform stuff: Huh, I never thought of that. I guess I'll take your word for it, then... I'm a complete beginner, so I expected to make mistakes.

    Edit: Curses, same technique doesn't work for the cutscene. Shame.

  • You don't need to do this for every kind of game, but the way the platform object works you're just going to run into trouble.

    It's generally good practice to create invisible hitboxes for most sprites anyway as oppose to pixel perfect collision I think. I think it's a fairly common practice but I usually draw my backgrounds seperately in photoshop and then after importing the image, build the platforms using hitboxes also, which makes the whole thing run a lot smoother.

  • A better way to handle pause is to use the ELSE condition and a subevent. Eg:

    + On P pressed

    ----+ (conditions saying it's already paused)

    ----> Unpause

    ----+ Else

    ----> Pause

    This way you don't need any flags or other events (and it's easier to make sense of too).

  • >

    > You don't need to do this for every kind of game, but the way the platform object works you're just going to run into trouble.

    >

    It's generally good practice to create invisible hitboxes for most sprites anyway as oppose to pixel perfect collision I think. I think it's a fairly common practice but I usually draw my backgrounds seperately in photoshop and then after importing the image, build the platforms using hitboxes also, which makes the whole thing run a lot smoother.

    True, but it's not exactly best for all games. Like a top-down space shooter for instance, where you don't really have walls or solid objects. Bullets hitting your ship would work better with Per Pixel in that case. Especially if your ship has an odd, angular shape (which most tend to do).

    A better way to handle pause is to use the ELSE condition and a subevent. Eg:

    + On P pressed

    ----+ (conditions saying it's already paused)

    ----> Unpause

    ----+ Else

    ----> Pause

    This way you don't need any flags or other events (and it's easier to make sense of too).

    Ah, that is better. I remember someone posting an alternative to my method before but I couldn't recall what it was.

  • Well I'll be darned, it works, and it solved the cutscene problem too! Thanks.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Alright, with my new version of my game, I have run into some new problems. The pause problem is now gone, the other problems, on the other hand, have yet to be fixed. Also, a major new problem has come up.

    Whenever the character goes into a room OTHER than the first room (from debug tests, this seems to occur in every room besides the "test" room), the character reverts to Julius, and falls through the floor. This is a curious thing, and despite my examining of the events, the source of the problem eludes me. Anyone got any clue?

    .cap file

  • That cap only has one layout, the one where you pick your character lol

    Do you have the sprite that indicates the player selected set on global?

  • Wait, what? Check the "project" tab on the side.

    Anyways, I've fixed the attack problem myself, but the next room thing is still there. Also, another odd thing, I've been testing a health meter and game over thing with an enemy, but when the health hits zero, it crashes.

    New version .cap file, now with sounds and music! And Soma Cruz, ON FIRE!

    Edit: Also, just to note, Ashe can shoot and Sonic can kill "Soma" too by jumping on him. Classic.

    Edit: Oh, this is hilarious. I just fixed the room problem through some collision tests, in an event, I set the character's collision box to "bounding box"... And now I've discovered that in the other layouts, the collision is PER PIXEL. Wow. I've been stumped by such a simple thing... Note to self. Set events for bounding box just to be sure.

    Edit2: Updated .cap to show... And now I'm back to an old problem, the game's refusal to change one bloody variable, in this case, "DoorSide". Argh.

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