Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

The 20 Line Challenge / Maze Game

Author
Message
Daemon
18
Years of Service
User Offline
Joined: 16th Dec 2005
Location: Everywhere
Posted: 27th May 2006 08:45 Edited at: 30th May 2006 03:55
Don't Bother Running the Code in this one. Run the updated one down later. It is a lot faster!

You can choose the dimensions of the maze you will navigate through.

Large dimensions will eat you. If you get impatient hit the spacekey to have it display what there is so far of the maze.



P.S. Don't try a one by one maze; if you want to be cheap choose a three by three maze. Just thought I would save you the time.

Insanity is just a state of mind

Attachments

Login to view attachments
Daemon
18
Years of Service
User Offline
Joined: 16th Dec 2005
Location: Everywhere
Posted: 28th May 2006 02:13 Edited at: 29th May 2006 17:21
I let it finish creating a maze for this screen shot. It is a 151 by 151 maze. I went to eat dinner while it was making it.

Insanity is just a state of mind

Attachments

Login to view attachments
Diggsey
17
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 29th May 2006 14:36
Are the black lines the walls, or the paths?
And have you tried

at the start?

There are three types of people, those that can count and those that can't.
Daemon
18
Years of Service
User Offline
Joined: 16th Dec 2005
Location: Everywhere
Posted: 29th May 2006 17:18 Edited at: 29th May 2006 17:19
The walls are white.

Putting sync on would have made it so that I had to sync for each input, inside the loop, and at the ending crdits; which would have been 5 more commands ontop of the sync on and sync rate 0. I didn't think it would make much of a difference as the part which takes a long time does nothing with the screen. It simply changes numbers in an array, creating a maze of 0's and 1's until at the end it draws boxes on the screen.

Also, did you notice that you could move through the maze using the arrow keys. I ask this because it would have shown you which were walls and you may notice that you don't fly through the maze, caused by the "sync rate 7" in the code. If you take this out it will be more difficult to move through the maze. On my computer it makes me move so fast that I can't get through a maze because I go all the way until I hit a wall with one quick touch of an arrow key.

Wow I rambled. Sorry.

Insanity is just a state of mind
Diggsey
17
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 29th May 2006 18:53
I don't have DBP, so I can't test it. But you should try the sync on thing. The thing that takes time to do is update the screen. Which you don't need to do. Use sync on at the start, then sync off when it comes to the credits. Believe me, it works.

There are three types of people, those that can count and those that can't.
Im still here
17
Years of Service
User Offline
Joined: 11th May 2006
Location: :noitacoL
Posted: 30th May 2006 02:29
This is pretty much the best game ever.
Daemon
18
Years of Service
User Offline
Joined: 16th Dec 2005
Location: Everywhere
Posted: 30th May 2006 03:51 Edited at: 30th May 2006 04:10
I should have seen that you have Dark Basic Classic from your other posts, sorry. Just out of curiosity since I never had DBC, which command do I use that DBC doesn't have?

Well, I didn't want to seem stubborn so here is the code with sync on. It is faster! And not just a little bit. So I owe you not just an apology for rambling (which I already gave) but also a thank you.



Diggsey, since you can't actually run the code I will just have to tell you that a 151*151 matrix now takes about 1 second compared to its previous >30 minutes.

Insanity is just a state of mind
spooky
21
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 30th May 2006 15:03
Interesting way you have drawn the maze. Trouble with it is the way from top left to bottom right is always along the diagnal, the path never really strays far away from a direct path.

Boo!
Diggsey
17
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 30th May 2006 17:51 Edited at: 30th May 2006 17:52
Thanks
In Classic, you can't define variables as global, so you'd have to pass the values into the function, but I can't really be bothered
Also, you can't have more than 256 characters on each line, so I'd have to space it all out.

There are three types of people, those that can count and those that can't.
Daemon
18
Years of Service
User Offline
Joined: 16th Dec 2005
Location: Everywhere
Posted: 2nd Jun 2006 02:32
This isn't really an update, it is just different. It uses the same maze function but makes it into a matrix.

3D Maze!



I suggest you don't do such large mazes with this 3D one because it will slow it down more.

Insanity is just a state of mind
Chris Franklin
18
Years of Service
User Offline
Joined: 2nd Aug 2005
Location: UK
Posted: 2nd Jun 2006 17:19
Any chance you could convert that matrix to an object? it was 3 fps here

Im still here
17
Years of Service
User Offline
Joined: 11th May 2006
Location: :noitacoL
Posted: 5th Jun 2006 07:22
I kind of did what Daemon did, just a little different. I've turned the maze into a free-flight 3D maze
A couple things to note:
A. This is my first time posting code, so if it doesn't show up, it's completely my fault
B. Don't back up into the walls. It's difficult to get out.
C. Daemon gets most of the credit for this, he came up with the original code for the maze. I just made it 3D-ish.
D.I would've compressed this more, but I just don't find compressing code fun when it's 12:00 A.M.

Login to post a reply

Server time is: 2024-04-18 18:04:32
Your offset time is: 2024-04-18 18:04:32