Comments: 89
MC117db [2012-01-12 04:26:48 +0000 UTC]
Is it possible you can release the fla. file? I am interested in the wall-jumping mechanics
π: 0 β©: 1
JohnJensen In reply to MC117db [2012-01-18 14:37:19 +0000 UTC]
I'm not really comfortable with sharing my .fla file, but I can tell how I programmed the mechanics.
Basically whenever you're touching a wall, I'm checking if the user is holding down the jump button at the same time, and then I make him jump (usually setting the gravity/y velocity variable to a negative numbers in my game programming method) and then I set the x velocity variable to a number that corresponds to the side the player is touching the wall: If the player touches a left wall, set x vel to 5, and if a right wall then x vel to -5, and y vel to -10. You can change those numbers until it feels right, those were just some I randomly came up with.
Hope it sorta gives you an idea of how it works.
π: 0 β©: 1
MC117db In reply to JohnJensen [2012-01-19 04:29:02 +0000 UTC]
Thank you, that has been really helpful. Just wondering, did you set separate hitboxes for each side of the the walls to check whether the player hits the left or right side of the walls? Or did you check for the current direction the player is heading when it touches the wall (check whether x vel is += or -= etc).
π: 0 β©: 1
JohnJensen In reply to MC117db [2012-01-19 12:31:39 +0000 UTC]
I always use the same movie clip for ground, so I always have different sides of the player checking for collisions on the ground. If I have a 20x20 ball as a player, I'd say (assuming the anchor point is in the middle) if(level.hitTestPoint(player.x-10, player.y, true)) to check the left wall and then player.x+10 for right wall, player.y+10 for ground and player.y-10 for ceiling.
Also another technique I usually use, is having a while() function for each of the sides, for example if the player is 4 pixels inside the wall, and is only pushed 1 pixel away for each frame it'd look weird like in this Flash, so I have a code like this for each side:
while(level.hitTestPoint(player.x-10, player.y, true))
{
player.x++;
}
so it basically keeps pushing him to the opposite side until he's not touching the wall any longer. I usually put the code after the first collision checks.
π: 0 β©: 1
KimBo007 [2011-03-28 13:51:37 +0000 UTC]
any usefull tutorials for making this kind of things?? dont like wall jumping tho
π: 0 β©: 1
JohnJensen In reply to KimBo007 [2011-04-02 14:23:16 +0000 UTC]
Look in my gallery for a platformer tutorial.
π: 0 β©: 0
HampoArgent [2010-11-16 07:38:47 +0000 UTC]
I'm working with a tile engine at the moment to, trying to upgrade it to AS3.0 from AS1. It's more of a platformer/parkour engine but if you'd like to swap codes or something, let me know.
π: 0 β©: 1
JohnJensen In reply to HampoArgent [2010-11-23 16:01:35 +0000 UTC]
yup, that's what you do ;)
π: 0 β©: 0
Eyaare [2010-04-11 16:21:12 +0000 UTC]
IDK if someone's said it, but I assume ammo is AMMO IN CLIP/OTHER AMMO. So you have to make if
if(OTHER AMMO <= 0) {
}
Else if (OTHER AMMO <= 0){
reload;
}
Wasn't mean to be an actual code, just a concepty-thing.
Also, yes, as has been said before, WASD controls.
And, finally, you should definitely do a tutorial, or upload the .fla, or something, preferably the tutorial one. So few of those exist for AS3 >.<
But nice work.
π: 0 β©: 1
Eyaare In reply to JohnJensen [2010-05-10 20:53:18 +0000 UTC]
Yes, but you see, my problem lies in a lack of knowledge of AS2. I get things like hittest, variables, basic movement and such but utilizing the mouse, setting angles and gravity I never could figure out.
UGH. It's very frustrating because I'm working on an identical game. We finally figured we'd try something somewhat different, though, but for the longest time a basic game engine had been holding us back.
π: 0 β©: 0
Jusey1 [2010-01-07 00:08:46 +0000 UTC]
Is there a actually game of this? Cause I was hoping for something to kill.
π: 0 β©: 0
WEEGEEXD [2009-11-08 12:44:54 +0000 UTC]
nice! you should totally make a game of it!
π: 0 β©: 0
Ninjapear [2009-10-09 20:03:30 +0000 UTC]
hey if this is a engine how do i download it into my flash???
π: 0 β©: 0
Narusim1 [2009-06-23 23:12:34 +0000 UTC]
Whats the script for shooting?
π: 0 β©: 0
bonniegayle [2009-06-21 22:29:56 +0000 UTC]
I started with 8/55 bullets. Next load was 7/56.
π: 0 β©: 1
Dark-Helmet1 [2009-03-28 11:03:54 +0000 UTC]
OMG!!! So... friggen... awesome... Dude you gotta teach me that kind-o AS3, cuz its simply AWESOME
π: 0 β©: 1
JohnJensen In reply to Dark-Helmet1 [2009-03-28 22:08:10 +0000 UTC]
Well, you could've done it with AS2 but.. yeah. xD
Do you have MSN or something? I could maybe tutor you a bit?
π: 0 β©: 1
Dark-Helmet1 In reply to JohnJensen [2009-03-29 12:42:08 +0000 UTC]
Sent your note back. take a look at it.
π: 0 β©: 1
Dark-Helmet1 In reply to JohnJensen [2009-03-29 15:26:05 +0000 UTC]
Can you note me yours too. I didn't really notice it -.-
π: 0 β©: 0
asikka In reply to JohnJensen [2009-08-03 12:36:19 +0000 UTC]
O rly?
π: 0 β©: 0
Rexus64 [2009-01-26 02:09:02 +0000 UTC]
I completely ran out of bullets...but its soo fun!(^-^)
π: 0 β©: 1
JohnJensen In reply to minibc [2009-01-18 22:04:53 +0000 UTC]
A level array could be like this:
myLevel = [
[0, 0, 0, 0, 0],
[0, 1, 1, 1, 0],
[0, 1, 1, 1, 0],
[0, 0, 0, 0, 0]
];
for(var i = 0; i < myLevel.length; i++) {
for(var j = 0; j < myLevel[i].length; j++) {
if(myLevel[i][j] == 0) { /* Wall */ }
if(myLevel[i][j] == 1) { /* Free space */ }
}
}
Could also use a switch() {} instead of the ifs.
π: 0 β©: 1
JohnJensen In reply to JohnJensen [2009-01-18 22:05:23 +0000 UTC]
don't forget var before myLevel. xD
π: 0 β©: 0
blueninja12 [2009-01-16 01:21:07 +0000 UTC]
You make this into a game!
π: 0 β©: 1
blueninja12 In reply to JohnJensen [2009-01-19 03:57:23 +0000 UTC]
...AND ADD SOME ENEMIES IF YOU DO. AND GIVE IT A HALF LIFE CONCEPT.
π: 0 β©: 1
blueninja12 In reply to JohnJensen [2009-01-19 19:01:46 +0000 UTC]
WHY NOT HALF LIFE YOU CAN ADD MISSIONS
ALSO ADD ACHIEVEMENTS
π: 0 β©: 0
snapel [2009-01-15 13:52:57 +0000 UTC]
Neat. Now it only needs good idea for it ; )
π: 0 β©: 1
| Next =>