Busy Bahrs

Thursday, March 5, 2009

Level Select Screen

For this version, I added a level select screen to the game. Now the first thing you'll see when the game loads is the new screen. It lets you pick a maze to play. After you finish the maze, you'll go back to the level select screen.

My first thought was to just have a grid of numbered levels that the player could pick from, but that would be hard to control using your eyes. So I settled on a north/south/east/west approach. There are four buttons per screen, each in one direction. Of course, there are only two mazes right now, but in the future there will be more.

Monday, February 23, 2009

Texturing


Texturing is projecting 2D images on to the polygons. I decided to make a hedge maze motif for the first iteration of the textures, but I want to do more in the future. Enjoy!

You may have to go to the web page where the maze game is hosted for it to work properly: http://students.cs.byu.edu/~jbahr/java/wad2/wad2.html

Wednesday, February 4, 2009

Mouse Control!

The goal of my capstone class this semester is to take the maze game and make it work for the Eagle Eyes hardware. Eagle Eyes makes the mouse controllable entirely by your eyes. It allows a lot of people with disabilities to use a computer, many of whom can't interact with their world in any other way.

Of course, there's no way to "click" with your eyes. So this new version simply makes the yellow ball follow the mouse pointer. The farther away the pointer, the faster the ball travels. Unfortunately, this breaks the switch functionality - there's no longer a way to press the switch. I'll fix this in the next version (probably).

I've also created a way to create "buttons." The idea is that if you hover over the button long enough, it should click. But there should also be visual feedback that it's going to click. A very simple example is posted on my CS web page, here.

Wednesday, January 28, 2009

Full Screen...Kinda

Here's the first version that goes full screen! Well, at least as full screen as I can get without paying Sun money. Of course, in the future it will allow you to choose full screen or not, but this was mostly to see if it would work.

I also changed it to be top-view. But with the change, I wrote it in such a way that you can easily change between top-view and behind-view. Look for a button or something in the future to toggle between the two.


UPDATE: The site where I host the maze game isn't accepting connections right now, so I haven't been able to upload the new full screen version. I'll remove this when I actually get it uploaded.


NOTHER UPDATE: The site's back up, so the new version should be up now.

Thursday, January 15, 2009

Version 0.91 - 3D!!!

Finally, here is the 3D version of the maze game. There is actually an END now, the white square. I will be continuing development on the game this semester as part of a capstone project. I'll keep updates coming.

By the way, landing on the end only stops the game. It doesn't do much else right now, but it will in the future. At least there's an end now!

Control is still done with the keyboard, except that left and right are now to change direction, and up and down are to move back and forward. I'm thinking of having it just be top-view, let me know what you think.

Friday, October 24, 2008

Version 0.9 - XML Maze Loading!

I've finally hacked out the XML maze loading. If you view source for the wad2.html in the iframe, you'll notice that there's now a src parameter to the applet. This points to the JMazeML file to load. I've posted a sample JMazeML that you can play around with. The source XML file for this maze is available here.

Of course, the plan is to allow users to edit their own mazes. There will be an editor at some point. But 3D is definitely a higher priority right now.

Also, I've moved to a different versioning system: it's now (major).(minor).(minorer).(etc). So don't be surprised if the next major version is 0.10 rather than 1.0.

Enjoy!

Saturday, October 11, 2008

JMazeML Tutorial

Until I get time to work on the editor, board loading will be accomplished through XML files. I've tried to make it as painless as possible. The editor will still be a lot easier though.

Anyway, here's a short how-to on the XML files. For a more formal spec, check out the DTD.

A good prerequisite to this is a little knowledge of XML, or at least HTML. If you have neither, you may want to read W3Schools' XML Tutorial first.

The root element in JMazeML is the jmaze element. It has a title and motif attribute. The title is just your title of the current maze, while the motif is the URL of the motif to load for the current maze. Currently the only value used for motif is default.jmtf. Both title and motif are required.

<jmaze title="This Maze" motif="default.jmtf">

Next comes the info. This element contains three subelements: author, website, and message. None of these are required, although an info tag is required. Here's an example:

<info>
<author>Jesse Bahr</author>
<website>http://students.cs.byu.edu/~jbahr/</website>
<message>Try to find the hidden treasure room!</message>
</info>

As you can see, the author and website are purely informational. If there is a message, the game will display it at the beginning of the maze.

Next is the big part: the layout tag. This tag contains all the information about the actual maze. The layout tag attributes, width and height, define how many squares the maze has. So for a 5x5 maze, i would do

<layout width="5" height="5">

Under a layout tag, we have 3 different things: definitions, rowFills, and the maze itself. The rowFills and the maze required the definitions to be made first.

A definitions tag contains a palette of sorts. It has all the different kinds of squares you will use in your rowFills and the maze definition. Each square should have an id element, which is used later.

I'll publish another tutorial that contains all the different kinds of squares you can define. For now, just look at the following example.

<definitions>
<normal id="n"/>
<blue id="b"/>
<end id="e">
<green id="g"/>
<orange id="o"/>
<red id="r"/>
<tport id="t" x="0" y="0"/>
<wall id="w"/>
<water id="W"/>
<arrow id="d" direction="down"/>

<normal id="q">
<item>GreenKey</item>
</normal>

<water id="B">
<item>boat</item>
</water>

<green id="G">
<item>BlueKey</item>
</green>

<switch id="s">
<pressAction>
<eventList>
<changeSquareEvent x="0" y="0">
<normal>
<item>OrangeKey</item>
</normal>
</changeSquareEvent>
<changeSquareEvent x="1" y="0">
<normal>
<item>RedKey</item>
</normal>
</changeSquareEvent>
</eventList>
</pressAction>
</switch>
</definitions>

I know it's a lot. Let's break this down a little.

The normal, red, green, blue, and orange squares are pretty simple; they just put one of these kinds of squares down. The normal corresponds to a square that allows you to walk over it and doesn't require a key. The color squares require the same color key. Similarly, the wall and water squares are self-explanatory, but I'll explaing them anyway. They define a square with a wall or water. Both stop the player from moving, but the wall also stops boats from moving whereas water does not.

The arrow square is a little different - it requires a direction. This defines a square that pushes the player in the direction specified. Directions can be up, down, left or right.

<arrow id="d" direction="down"/>

The tport square is similar. It is a teleporter which teleports the player to a certain location, as specified by x and y. Note that these are 0-based, with the (0, 0) point being in the top-right corner of the maze.

<tport id="t" x="0" y="0"/>

After the arrow square, we have another normal square. This one is slightly different, though; it has an item. This particular square has a GreenKey item, which is simply the green key. Some other items include Boat, Treasure, and the other color keys. You can define an item for any of the squares, as you can see with the next few squares.

<normal id="q">
<item>GreenKey</item>
</normal>

Finally, we have the switch square. I'll get more into square actions and events in another post; suffice it to say that this defines a switch that when pressed, places the red and orange keys on the board.

Now that the definitions are finished, we can finally define the actual board. If you do single-character ID's for your square definitions like I've done above, the board can be defined as simply as this:

nnnnn
gBbdo
GWsdr
WWwde
qnwnt

This lays out each element from my palette above into the maze. Note that whitespace doesn't matter here; it simply lays out the squares from left to right, top to bottom until they're all laid out. (Extra squares would result in an error.) Actually, I could have just as easily done

nnnnngBbdoGWsdrWWwdeqnwnt

and it would have resulted in the same maze.

So the first 'n' in the top-right corner says to put the square with id 'n' in the top-right corner of the maze. Looking back to our definitions, this is

<normal id="n"/>

- simply a normal square. Continuing on, each character in my maze turns into the square with the matching id. So the next 4 n's turn into normal squares, then the 'g' turns into a green square. (and on and on and on.)

I'll go over what to do if you want to use multiple-character id's in another post.

Finally, close the layout and jmaze tags.

</layout>
</jmaze>

When I post the new version of the game that actually does the maze loading, I'll post this maze and link from here to the source JMML of the maze.