ForumsProgramming ForumMaze Game

42 12776
Maaron
offline
Maaron
47 posts
Nomad

Hey everyone,

I'm making a maze game but I'm having a bit of trouble. When you hit the walls you are sent to a different frame where it tells you that you have lost, here is the code for that:

if (Wall.hitTest(Player._x, Player._y, true)) {
gotoAndStop(2);
}

That works fine, it's just the restart button I can't get working, I click on it and nothing happens, here is the code:

Retry.onRelease = function() {
gotoAndStop(1);
}

I have no idea why it won't work, please help me.

  • 42 Replies
Captain_J_Sheridan
offline
Captain_J_Sheridan
313 posts
Nomad

You can find all the key values in Flash Help, press F1 and look for "Keyboard Keys and Key Code Values"

Maaron
offline
Maaron
47 posts
Nomad

Hey everyone, again,

I have now gotten a pause menu, a life system and a bad guy in my maze now. Just wanna show you all.


http://spamtheweb.com/ul/upload/031208/66123_Maze_Game.swf

rumen
offline
rumen
307 posts
Nomad

Man, your game is very good! Try adding more bad guys!

IQAndreas
offline
IQAndreas
299 posts
Peasant

Fantastic! You are really getting there.

In no time you will be publishing games for AG.

Captain_J_Sheridan
offline
Captain_J_Sheridan
313 posts
Nomad

Nice, high five o/

That's my Borat compliment

Maaron
offline
Maaron
47 posts
Nomad

Man, your game is very good! Try adding more bad guys!


Thanks mate, I'm gonna do that soon, first I'm going to make the maze harder .

Fantastic! You are really getting there.

In no time you will be publishing games for AG.


Thanks, HAHA, I hope.

And last but not least

Nice, high five o/

That's my Borat compliment


Thanks and LOL.
IQAndreas
offline
IQAndreas
299 posts
Peasant

You could try making the whole maze or parts of the maze move around.

Just wondering, how are you doing collision detection? Are you using hitTest on all "bits" of the maze?

BehemothBoy
offline
BehemothBoy
33 posts
Nomad

No, I'm doing it all in one big bit. Why?

BehemothBoy
offline
BehemothBoy
33 posts
Nomad

lol, sorry all, this is my new account.

IQAndreas
offline
IQAndreas
299 posts
Peasant

Just curious. I am currently learning many different ways of doing collision detection, and I thought that if each individual bit was hittested, it might be a bit CPU intensive, yet your program seems to work just fine.

I learned that hitTest == evil, so I'm searching for different alternatives, and there is a lot out there.

BehemothBoy
offline
BehemothBoy
33 posts
Nomad

Really, I only know of a few. I've got all the walls in one movieclip and am using a shapeflag hitTest. Yeah I mentioned the enhance code idea in your other thread because that is something I really want, I just don't feel my code is correct. it works and everything but that doesn't mean its good. If you know what I mean .

hitTest == evil


I see your getting to used to coding in ActionScript :P.
BehemothBoy
offline
BehemothBoy
33 posts
Nomad

Hey all,

Just a quick update for my game, I've done what all you guys suggested, I can't believe how much I've learnt from doing this. Anyway here it is:

[url=http://itiz.in/f9tp]

Showing 31-42 of 42