Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
Please help with maze! Pretty Please.
Old
Cindy
Guest
 
Status:
Posts: n/a
Default Please help with maze! Pretty Please. - 04-22-2010, 10: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..
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default 04-22-2010, 10: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
File Type: a2w fatBot (2).a2w (1.55 MB, 51 views)


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

Last edited by Dameria; 04-22-2010 at 06:32 PM.
   
Reply With Quote
Old
Cindy
Guest
 
Status:
Posts: n/a
Default 04-22-2010, 10:29 AM

Well we were going to do that but like it had too many blocks and it was hard to organize them.
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default 04-22-2010, 10:31 AM

Quote:
Originally Posted by Cindy View Post
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:

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
   
Reply With Quote
Old
Cindy
Guest
 
Status:
Posts: n/a
Default 04-22-2010, 10:34 AM

Thanks alot we really appriciate you helping us on this.
Attached Files
File Type: a2w fatBot.a2w (2.19 MB, 9 views)
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default 04-22-2010, 10:53 AM

This shouldn't be too hard. I actually expected there to be a lot more than this. You're program is not very... in depth. If you want, I can add some things to your world to make it a lot more creative, like a scoring system, timer, different point of views, etc. By doing this, however, it would be almost like cheating, do you still want me to do it? I have already fixed some things like putting all of the lollipops in a group and creating a very simpler "click" method to make them disappear (I made it so that they only disappear when you are 8 meters away from them, so that you cannot just go through and click all of them at once, you actually have to find them first.)

I will work on the collision detection now, but if you want me to add other things like a scoring system just ask and I will.


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
   
Reply With Quote
Old
Cindy
Guest
 
Status:
Posts: n/a
Default 04-22-2010, 10: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
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default 04-22-2010, 11:02 AM

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
   
Reply With Quote
Collision Detection!
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default Collision Detection! - 04-22-2010, 04: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
File Type: a2w fatBot (2).a2w (1.55 MB, 36 views)
File Type: a2w fatBot (1).a2w (2.36 MB, 23 views)


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

Last edited by Dameria; 04-22-2010 at 06:21 PM.
   
Reply With Quote
Finished
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default Finished - 04-22-2010, 06: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
File Type: a2w fatBot (2).a2w (1.55 MB, 47 views)


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

Last edited by Dameria; 04-22-2010 at 06:30 PM.
   
Reply With Quote
Reply

Thread Tools
Display Modes

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 Jump



Copyright ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.