Limit setting problem (FLA and SWF)

I’m trying to restrict my character (red burglar) from hitting the walls. So far it’s not bad, but there are bugs. Basically the bottom bottom isnt being reconized all the time and I don’t know why. The top limit and the left limit work great. The bottom one doesnt.

HTML w/ SWF (properly sized):
http://www.prophecydesigns.com/matt/burglar/burglar.html
FLA:
http://www.prophecydesigns.com/matt/burglar/burglargame.fla

A couple of other things is. I want the top limit (the brick wall) to react to the bottom of the hero, so it looks more realistic like he is actually next to the wall. How could I hit test his bottom? Instead of the top of his circle?

Another thing is, I want to implement jumping (you jump over or on the cop circle guy in the game) so how would I implement that with these limits?

As you see in the FLA, I’ve done all the art but I want to know how to program what I need now. I don’t want you guys to just do it for me. So send me FLAS, but please explain so I can learn :slight_smile: :slight_smile:

matthew@prophecydesigns.com is where you can send FLAs too

Thanks! Or respond here of course :slight_smile:

Oh yeah, I also want the limits to scroll when you go far enough right (the right side of the stage) or scroll left when you hit the left side (unless its already all the way over).

Basically my concept for this game is you play the bandit circle and you try to sneak by/jump over (or on to knock him out) to get by into that circle hole where you would win. Simple game to test my A/S game knowledge. You lose if you get spotted (hittest) by the flash light shine. :slight_smile:

Hey kerek, sorry I havent been teaching you through PM, been busy. Okay, if you want the wall to react to the bottom of the character, dont make the limits on the top wall so low then. move them up. And for the bottom, you just need to thicken the bottom wall :P.

fla coming…

Scrolling help coming…

Also, if you notice in the FLA that I have jumping kinda working but it wont play the jump frame animation. How come?

EDIT: I tried to thicken the bottom and it worked, thanks

Hmmmmmm… Ill look into that immediataly. but first, the fla for the hitTest problem =).

I fixed the bottom thing myself but let me look at yours anyways :slight_smile:

EDIT: Obviously I mean with your advice above, not by myself. :slight_smile:
Man, nice FLA, makes a lot more sense now!

got it! here is the jumping fla ( by the way, take a look at the jumping code in the fla. It is good for fighting games :rambo: ):

P.S. My dad and I like your art :D.

Haha, my art sucks! So I made it funny looking. :slight_smile:

I got my limits working now. Yay. One thing, let’s say we want the robber to be able to jump up to that window sill (the jail window thing). How do we make that thing a new limit so its jump on-able?

EDIT: I took your jumping code, but it doesn’t work in my FLA. I changed it so it tells it to go to the jump frame but it wont go or do anything. :frowning:
My FLA is updated in the original post.

Hmmm… window sill, eh? Not to disappoint you, but I dont think I know how ( on this type of game, that is ). I do, however, know how to make the scrolling, and the AI of the cop.

EDIT: Study my game. The part I would like for you to study, is the

if (!this.started) {

and the

 this.started = //true or false// 

that is part of your problem.

Yeah if the hit test of the flash light is true, game over.

If the hit test of the cops head is true (and jumping of hero) then the cop gets smushed and his MC is removed.

If the hit test of the hero and the hole is true then the game is won!

If the hit test of the hero and the cops body is true, then the hero loses!

Those are what I planned out

EDIT: I noticed one thing that would be nice to know aswell. Is it possible to control the depth of the hero depending on the cop? Say the cop is in the middle of the grass and then we want to go behind the cop, then the depth should drop to behind the cops layer but if we are in front of the cop, it should drop to above.

Planned nicely ;). About the jumping problem again, you didnt have the right number for the frames :)! I had four frames for my char: right, down, up, and jump. Jump is the fourth frame, right? Well, if I want it to go to the jumping sequence, I put:

 if (Key.isDown(Key.SPACE)) { 
			this.gotoAndStop(4);
		}
} 

In the this.gotoAndStop(4), the 4 represents the char’s fourth frame because the jumping sequence ( for my game ) is on the chars forth frame. Thus, 4 = “jump”.

I got my jumping working now and with animations.

I think if you are jumping and you hold LEFT or RIGHT it should go that way a bit too (just nitpicking as a gamer :))

Yeah, I got the jump stuff. I just didn’t add the start check, so it didnt know if it was started or if it wasnt. :slight_smile:

EDIT: Actually, could you explain the jumping code a bit. I don’t understand it entirely. I would like to edit it to make the jumping a bit higher and make the red bandit come down quicker but if you do it for me, I won’t learn. :slight_smile:

I want to learn so I can make the second level by myself :slight_smile:

I tested your game again. Exellente! Brings a tear to my eye :smirk: .

EDIT: Okay, The “startspeed” is how fast he goes up. The “gravity” is how fast he drops down, and the “jumping” is determined if he is jumping or not. The “startpos” is where he was when he jumped. So when it says:

 if (_y>startpos) { 

he will go back to not jumping or falling.

Oh crap! its 1:00! I gotta go or my parents will kill me! We will pick this up tomarow, ok? goodnight!

Yes, it’s definetly looking like a game! :slight_smile:

I actually understand too. The limits thing is easy now. I think I might know how to make a sill.
We just make a new limits layer with the sill called limits2 (or whatever) and we test the hero on that. If he hits the top of the sill then he stays on there… so you would stop the falling and make it act like he is on the ground until he gets to either end, then he would fall again.

EDIT: Sure, email me the FLAs if you finish them and I’m not here. I have to work a lot tomorrow so just email me them.

Good stuff so far

Hey kerek, you on?

kerek, you on?

I am now. Let’s get the jumping going left to right or the scrolling

Ok, Shall we start?

yes lets add scrolling and the jumping sideways