Under rating threshold (hideshow)
I am using the wall jump behavior gotten from the platform kit. My problem is, when my hero jumps, on a wall, he bounces back diagonally really far...
The premade behaviors were never meant to be changed around, which is why I am basically 100% against using them. I cannot count how many times I've had to help out new programmers who have tried to change them around and practically crashed them. This tutorial is designed so that you can make your OWN and LEARN how to do it. Don't try to do it with a premade. Understand how the coding works and make it yourself ;).
Under rating threshold (hideshow)
I did what you said in your reply, but everything seemed to be exact. My character just starts sliding without me pressing the button at all! Something is wrong! Please try to find the answer! If you want, I can email you the game and you can send me the solution.
Upload the game file to StencylForge (it's in the publish top bar menu), make it public, and tell me the name, and I'll try to look at it for you. You can also come to my livestream (livestream.com/stencyl) so that we can chat in real time and I can show you what's going on (note that I now go by "Tuo" instead though).
Under rating threshold (hideshow)
Please help! I had finished up to step 32 when I decided to test my game, but when I opened it, my character would start slowly going right without me pressing anything! Please help me!
You probably have an x-speed setter that is outside of the "if right is down" conditional. Go through your "always" statement and see if anything is out of place. You also might have forgotten an "otherwise, set x-speed to 0" in the coding.
Under rating threshold (hideshow)
Well, I figured out which coding to remove to disable jumping off the wall, though this info might be useful in your tutorial. 1 other question, do you know how to make it so one directional key doesn't take precedence over the other? Like, right now, if you push left and right keys at the same time, it always goes left. Anyway to keep this from happening? Thanks.
What do you want the player to do if both are held down? You could use an extra condition before both the left and right coding to check to see if left AND right are down (and then do the coding in there, switching the next code to an "otherwise if" instead of "if").
Under rating threshold (hideshow)
Another great tutorial! I'm not sure I understand what everything does, but I got it working! However, how do I make it so my character can't jump off the wall at all? I changed the friction to 1, and now he slides down the wall, but I can still use the wall to jump off of. I don't want to be able to double jump or use the wall to jump higher at all. Thanks.
Ah, I naturally assumed that anyone making a platformer wanted wall-jumping. To disable it, only check for collisions when the bottom of the player is hit (instead of also checking sides). To make sure that double-jumping is off, you can use a boolean with a short delay; as you jump, turn off the boolean (and then have a short delay and turn it back on), and then in the collision coding, only reset the jumping if the boolean is on.
Under rating threshold (hideshow)
Great guide, Abigayl. But I have two problems with my game: My first problem is that my character seems to be just sliding on the ground for no reason at all. My second problem is that I can't fall through holes! Even if I jump into them, my player seems to be just walking on air!
Please help me!
Sounds like you forgot to turn on gravity in the scene (or let the player be affected by it). I'd suggest checking there first. If that doesn't solve it, upload the game to StencylForge (make it public and tell me the name), and I'll try to look at it for you.
Under rating threshold (hideshow)
Amazing tutorial series! But for this one, my player seems to slide down the wall VERY slowly. Changing the friction values doesn't seem to be effective in changing this. Any tips?
Have you changed the friction to 0? If it's not actually 0, then it still won't work. If that's been done, you can upload the game to StencylForge, make it public, and tell me the name, and I can try to take a look at it directly.
Under rating threshold (hideshow)
Another great tutorial, as always. But I seem to have run into a bit of a problem somewhere around Step 33-- my character can only jump! I know I did something wrong but I cannot find where the problem occurred. Any help would be appreciated!
The easiest way for me to help is for you to upload the game to StencylForge (top menu -> Publish -> Share on StencylForge -> Make public) and then I can see it directly.
Under rating threshold (hideshow)
Great guide thanks, worked perfectly on Windows. Currently trying again on Linux, can't get the GUI to drop an 'otherwise if' into a chain, specifically step 17 of this guide. Definitely a Stencyl/Linux problem and not yours. It looks like I'll stop being lazy and get back to pure code using an unrestricted open source engine! But seriously, thanks again for all of your stencyl guides - you are making game development less scary for thousands of people, which will have the added benefit of better games for everyone, sooner or later!
You have to hover the "otherwise if" over, almost on top of the top of the "if" to snap it in place. I agree that the method doesn't make sense, but it's how Stencyl works :P.
Under rating threshold (hideshow)
You have inspired me to start making flash games now that they are free to make! :D See you in the new games I make! :)
Under rating threshold (hideshow)
I got this error after testing. I did the code positions correctly..
Behavior: ActorEvents_37 at line 78
Syntax error: else is unexpected.
else if((actor.getXVelocity() < -1))
Behavior: ActorEvents_37 at line 83
Syntax error: else is unexpected.
else
Can you PM me a screenshot of the code? My guess is that you have an "otherwise if" without having an "if" or another "otherwise if" directly before it.
Under rating threshold (hideshow)
Ooops. comment too long. my bad. Since “The bottom of actor 1 is hit” is evaluated first in the “if” chain. I wanted to change the logic so that if the player was touching the right wall he would jump top-left instead of straight up. So I moved the group of blocks "Otherwise if the right side of actor 1 was hit..." ahead of the groups of blocks "If the bottom of actor 1 was hit..." (and made the order of the If/Otherwise blocks consistent again). But it didn’t work. Even if I’m pressing the right key to keep him “leaning” into the wall he still jumps straight up. (He correctly jumps top-left if he jumps when in the air.) Since the order of the statements is “IF the right side”, “Otherwise if the bottom”, “Otherwise if the left side”, then when I’m leaning against the right hand wall, how is jump (the variable) ever getting set to “Bottom?” I assume the problem is somehow connected to that. Thanks again for the tutorial and the help. -Csaba
If you want the actor to jump at an angle, I think all you need to do is take out the "if jump = air" in the collision statements. That is the reason they were put in (to stop it). You might have to make the bottom tiles before wall tiles for it to work the way you want, but it should do it for you.
Under rating threshold (hideshow)
Abigayl, Thanks again for a wonderful tutorial. Complicated, and I can see why it's even harder to explain. Great job. A few questions: 1) You check when the left and right keys are pressed down whether the speed is >20 (in the respective directions). But if the code sets the speed at 20 how can if ever get above 20? 2) It took me a while to understand that "Hit" can effectively just mean touch. In a literal sense, a player just standing doing nothing isn't hitting the ground but that's the way the blocks are labeled and I assumed gravity had something to do with it. And the logic in the blocks is that if he is touching the ground, the jump force is straight up even if he is also touching the wall.
1. The point of having a limiter is to stop infinite acceleration. It is supposed to be impossible to go beyond 20 speed. You can manipulate the coding to have different amounts of force for different speed levels (such as adding in "otherwise push self with 0.1 force" or something) if you don't want to limit the amount. 2. Hit does actually mean "hit". That is why the sliding code works (the falling normally if not pressing against a wall). They have to be rubbing together for a collision to occur, not just next to each other. Gravity is what causes the actor to "hit" tiles below him. And correct that he should jump straight up when on the ground, else it looks weird.
Under rating threshold (hideshow)
this tutorial is awsome my sister was complaining about a game i found on the internet and i said if you dont like it make your own she said why dont you wait you cant it was funny when i proved her wrong
Wow, if this tutorial made a better game than that game... that's bad. This tutorial is not designed to be an end-creation in itself but rather give you the tools you need to expand and make good games ;).
Direct right is 0, down is 90, left is 180, up is 270. Thus, up-left (45 degrees) would be 180 + 45 = 225 and up right would be 270 + 45 = 315. I probably should have mentioned that...
Under rating threshold (hideshow)
Thanks for another nice tutorial. It was more complicated to follow than the first one, but the screenshot at the end (slide 44) helped a lot. Good luck Abi, will be waiting for Tutorial 3.
Aye, that was one of the reasons why this tutorial took a while: jumping itself has been known to stump many programmers, including some vets I know. It's tough to take a difficult idea and make it simple to understand... glad the end helped :)
Under rating threshold (hideshow)
I sat here and hit the game at the end over and over again just to see if I would get anything. I think back and wonder " where did my last 10 minutes go?" Well, seems well done to me... makes little sense because I still don't have the software, time, patience, and/or intelligence to make a game but it sure is great to read something new.
P.S. YAY 2nd comment that is on "Best" for me.
Under rating threshold (hideshow)
Thanks for all the help, after completing this tutorial the game that I've been working on has improved. Also, if you ever need me to test any tutorials, you know where my email inbox is. :)
Under rating threshold (hideshow)
Thank you everyone for your support, as well as your patience in waiting for this tutorial to come out. Jumping can be one of the most complicated things to program, and even worse to explain, but I hope it makes sense. :)