Cindy Guest   Status: Posts: n/a Please help with maze! Pretty Please. - 04-22-2010, 11:18 AM Me and my partner are doing a final project in a class and it involves a maze and a boy. The problem is that the boy can run right thru the maze and we don't want it to. The maze has no sub parts so we can't even add a boolean function or anything. How do we prevent this from happening? please help us..
Dameria
Senior Member

Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
04-22-2010, 11:24 AM

Well theoretically you could put a whole bunch of 2-d squares all around every edge of the maze and put them all into a list and then make a simple collision detection method from there.

The hardest part would just be to organize all of those squares to every side of the maze, and you may have hundreds of squares depending on how big and complex the maze is. Also, if you do this, make sure all of the squares are facing the same way; don't have one square facing towards the wall, and another square facing outwards, have them either all facing either towards the wall or all facing outward.
Attached Files
 fatBot (2).a2w (1.55 MB, 49 views)

Check out my best projects so far and please comment:

Last edited by Dameria; 04-22-2010 at 07:32 PM.

 Cindy Guest   Status: Posts: n/a 04-22-2010, 11:29 AM Well we were going to do that but like it had too many blocks and it was hard to organize them.
Dameria
Senior Member

Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
04-22-2010, 11:31 AM

Quote:
 Originally Posted by Cindy Well we were going to do that but like it had too many blocks and it was hard to organize them.
If you want you can post your world and I'll see if I can organize them for you. I might even create the collision detection method if I am inspired to.

Check out my best projects so far and please comment:

Cindy
Guest

Status:
Posts: n/a
04-22-2010, 11:34 AM

Thanks alot we really appriciate you helping us on this.
Attached Files
 fatBot.a2w (2.19 MB, 9 views)

 Cindy Guest   Status: Posts: n/a 04-22-2010, 11:57 AM Well like it is sort of like cheating. But i have to go to my next class. We wont be back on untill tomorrow. So like if you want go ahead and try it out
 Dameria Senior Member     Status: Offline Posts: 976 Join Date: Sep 2009 Location: United States 04-22-2010, 12:02 PM I won't have this done for another hour or so, maybe longer. Check out my best projects so far and please comment: Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548 Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408 Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725 Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301
 Collision Detection!
Dameria
Senior Member

Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Collision Detection! - 04-22-2010, 05:32 PM

Hey, I got all the walls in along with a pretty good collision detection running on it. This is the first time that I have implemented my method of collision detection into an actual game, and considering that it has over 50 items that have to collide with the person, it is pretty good!

It took a few tries for me to get one that didn't make the whole game lag, but I finally thought of a new way by using infinite loops instead of implementing it into the walking system, and it seems to work a lot faster. The game is still a little laggy, I would say it is only about 8 frames per second, but considering the number of walls there are you are lucky it is that fast.

Tell me if there are any problems. If it is too slow, tell me and I will make the necessary changes, also same goes for if you can go through the walls. It doesn't do that for my computer, but everyone is different so it might do that for you. I can fix it, just tell me if it happens. Also I might implement a scoring system into this.

fatBot (2) is the improved game, so I moved it above fatBot (1). Number 2 has everything that number 1 has and more, including a scoring system and timer (see post below). I have left fatBot (1) here for download just in case you want to see it anyway.
Attached Files
 fatBot (2).a2w (1.55 MB, 36 views) fatBot (1).a2w (2.36 MB, 23 views)

Check out my best projects so far and please comment:

Last edited by Dameria; 04-22-2010 at 07:21 PM.

 Finished
Dameria
Senior Member

Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Finished - 04-22-2010, 07:18 PM

Ok here is the final product. I added a points system so that every lollipop you click on increases your points by 5, but it can increase as much as 3 times per lollipop, so you can get a maximum of 15 points per lollipop (I don't know why, its a weird glitch but it works out fine so no problem). If you reach the end of the maze before you have passed 2 minutes (the timer is on the top left of the screen) then you get a time bonus depending on when you finish (120 minus however many seconds you have played for). It then counts up the time bonus to your overall score.

It is actually pretty fun seeing how many points I can get in the little time that I have. Also it was a nice little challenge that helped refresh my Alice skills, thanks

Tell me if there are any bugs or glitches.
Attached Files
 fatBot (2).a2w (1.55 MB, 47 views)

Check out my best projects so far and please comment:

Last edited by Dameria; 04-22-2010 at 07:30 PM.

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Announcements     Community News and Announcements Alice 3     How Do I?     Works In Progress     Share Your World     Share Custom Classes     Bugs and Trouble Shooting     Suggestion Box Alice 2     How do I...?     Works-In-Progress     Share Worlds     Share Objects     Bugs and Troubleshooting     Suggestion Box Educators     Teaching with Alice     Teaching Using Alice 3     Teaching Using Alice 2     CS Principles and Alice     AP CSA and Intro to Java and Alice     Workshops     Alice Player and VR General Discussion     Questions and Comments     The Lounge