Double jumping/character selection help

For questions about using Classic.

Post » Sun May 24, 2009 4:16 am

Hello all. I'm working on a project for my english class, essentially a very low-end copy of the popular Super Smash Brothers franchise, except with characters from the books we're read throughout our highschool careers.

I've run into a few problems that I can't seem to solve on my own, and an explanation or example would be greatly appreciated.

The first problem is double jumping. I can't seem to find a good tutorial on setting the conditions for it, and if there's a preset, I couldn't find it.

The second is character selection. Essentially all the characters will have the same movement and attacks (for now), so all I really need is a menu/option that will change the skin on each player's character. I've included in this little mock-up I've made two characters, with the controls set to one.

Any help would be greatly appreciated. We've been given a week to do the entire thing, so I'd like to get these issues out of the way asap. Thanks!

http://dl.getdropbox.com/u/676998/HsBkl ... %200.2.cap
B
2
G
3
Posts: 17
Reputation: 884

Post » Sun May 24, 2009 5:18 am

Double jumping can be solved with the platformer behavior you are using by simply making a check on your jump button like...

+is 'Jump' pressed
+is 'Player' in Air
+then do Jump
B
2
G
3
Posts: 15
Reputation: 880

Post » Sun May 24, 2009 6:11 am

[quote="Prosthetix":s9bj1ere]I'm working on a project for my english class... we've been given a week to do the entire thing...[/quote:s9bj1ere]

Wow, one week? Perhaps you should have made very sure you were able to do the things you need to do before committing to this assignment.

Anyway, here's some theory on making a character select:

[list:s9bj1ere]
[*:s9bj1ere]Create a grid or line of character portraits[/*:m:s9bj1ere]
[*:s9bj1ere]Create a "selector" sprite that is a box outline or whatever[/*:m:s9bj1ere]
[*:s9bj1ere]Move the selector with the arrow keys in grid units[/*:m:s9bj1ere]
[*:s9bj1ere]When the selector is overlapping a character, set a global variable "playerOneChar" with that character's name[/*:m:s9bj1ere]
[*:s9bj1ere]Hit Enter or whatever, selector sprite changes color[/*:m:s9bj1ere]
[*:s9bj1ere]When the selector is overlapping a character, set a global variable "playerTwoChar" with that character's name[/*:m:s9bj1ere]
[*:s9bj1ere]Hit Enter or whatever, level starts[/*:m:s9bj1ere]
[*:s9bj1ere]Start of level, get global('playerOneChar') and set player one's sprite accordingly[/*:m:s9bj1ere]
[*:s9bj1ere]Ditto for player 2[/*:m:s9bj1ere][/list:u:s9bj1ere]
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Sun May 24, 2009 7:14 am

Set the platform movement to a rectangular solid sprite. Position animated character sprites to it. Have a variable to have 1 visible and the rest invisible. Use Families for the animation events.

For when you want the characters to do different things add in event sheets/groups to indvidualise them(the platform movement and actions etc) and switch the groups on/off along with the animated character sprites.
B
9
S
2
G
4
Posts: 346
Reputation: 2,726

Post » Sun May 24, 2009 7:36 pm

Thanks for the help everyone. I do have a week to do it, but while the rest of my class is fumbling around with construction paper and markers, I assume even a failure of a game will be far beyond my teachers expectations. I'm going to work on implementing the above now; when I make some progress I'll probably post the updated version. Thanks again.
B
2
G
3
Posts: 17
Reputation: 884

Post » Sun May 24, 2009 8:51 pm

[quote="revolther":2zff78kc]Double jumping can be solved with the platformer behavior you are using by simply making a check on your jump button like...

+is 'Jump' pressed
+is 'Player' in Air
+then do Jump[/quote:2zff78kc]

This will not work the way you think it does because it does not limit the amount of times a player can jump. You need to make another condition that checks if the player has already double jumped and then set it back to 0 when he lands.
B
5
S
2
G
4
Posts: 632
Reputation: 2,829

Post » Mon May 25, 2009 5:05 am

Yeah, I got around the above by setting the previously stated conditions, but also creating a 'Double Jump' private variable. One is added to the variable every time the player jumps.
It looks like so:

1[Player is jumping-----------------------]-------------------------{Do jump}
-[=//=Player is on ground----------------]
-["Double Jump" is equal or less than 1]

2[Player is on ground---]------------------------------------------{Set "Double Jump" to 0}
-[=//=Player is jumping]


The last condition had to be added because when the player jumped, as he left the ground, Double Jump set to zero due to a tick while still on the ground. This allowed the player to triple jump, as well as reset the counter by passing through platforms.


Efficient?
B
2
G
3
Posts: 17
Reputation: 884

Post » Mon May 25, 2009 5:42 am

Hmmmmm. I've been looking, and I can find a lot of chat about how you can't attain jump sustain by manually writing P2 controls. Anyone care to give me a hint at how I write P2 controls at all? I'm not worried about losing sustain or mild functionality. How do I..... I guess disable the standard controls for Player 2, yet allow them to still function for player one? Or is there a more efficient way?
B
2
G
3
Posts: 17
Reputation: 884

Post » Mon May 25, 2009 8:33 am

Basically, the gist is that manual Jump actions don't respect jump sustain. So if you tell an object to jump with an event (instead of the object receiving an actual a control press) then there will be no jump sustain, because basically there's no action that says "hold the key down for a while to sustain the jump." And since there were no official player 2 controls previous to .99, the only way to make a second player was to manually tell a second platform object to jump with an event.

Now, in .99 and above, there are proper second player controls that can be configured in the app properties, so you can set up real jump controls and have real jump sustain for a second player. So if you're lucky enough to be able to create and export your project with the unstable 0.99.2 build by the time your project is due then you should be golden.

But if you don't want to take the chance that you might not be able to finish an already risky class project then I suggest using 0.98.9 and just not having jump sustain.


And I guess that's all rather beside the point. Here's how you manually make a Player 2 with events:

Start of layout -> Platform2: Ignore Input (on the P2 object)
Key (move right key) Is Down -> Platform2: Set X Component of Motion to positive amount
Key (move left key) Is Down -> Platform2: Set X Component of Motion to negative amount
Key (jump key) Is Pressed -> Platform2: Jump

Those are just the basics, though. You will need to tweak it a bit to work properly.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Mon May 25, 2009 12:45 pm

[quote="Prosthetix":2zdc0nnt]
1[Player is jumping-----------------------]-------------------------{Do jump}
-[=//=Player is on ground----------------]
-["Double Jump" is equal or less than 1][/quote:2zdc0nnt]

You need to increment double jump and just check if it is 0
B
5
S
2
G
4
Posts: 632
Reputation: 2,829

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests