LunarLander using the Maya API
Create a custom Maya plugin to produce an accurate (research) Lunar Lander landscape with First Order Nurbs Curves on the XY plane. The terrain should contructed from equally spaced spans/sections and be customizable using a dialog box for data input, for example:
Add custom attributes ( gradient and intersect values for each line segment) for later collision detection with the Lunar Module. Think about how the terrain will behave in the finished version of the game.
This game will be played using Maya as a game engine, thereforeÉ Maya will be launched and the user will use a MEL script file to initialize the game. The user will be presented with a dialog box to set specific game settings.
The MEL script will create necessary nodes and connect them. It will also open a new view window to present the terrain and general game play window to the user.
The player will then use the connected joystick/controller to move the lander around the landscape. If the lander collides with the terrain the game is over and the lander disappears from view. If the user lands the lander on the flat part of the terrain the user wins the game.
The GenTerrain plug-in makes available a command that can be called from the command line and/or MEL to generate terrain for the Lunar Lander to navigate. The GenTerrain command has undo and redo abilities and accepts the following arguments.
When the GenTerrain Command is called, it parses the command-line arguments, builds and draws a nurbs curve on the x/z plane to be used as terrain.
The LanderNode plug-in is a DAG Node that is derived from the MPxLocatorNode class. This is a custom locator that has a specified appearance, attributes and abilities. Using OpenGL the locator is given itŐs Lunar Lander shape. The draw function also handles collision animation, thruster fire and player HUD type statistic updates. The following custom attributes have been added to the Lander node:
The joystick node connects maya to the joystick device.
User Interface (MEL)
The MEL script builds the UI, creates the nodes and connects them through script generated expressions.
Testing was done mainly though creating each node separately and calling the terrain function on itŐs own with out the lander. The joystick plugin was tested by connecting it to a sphere in a blank scene first. Modifications were made before "gluing" everything together with the final MEL command.
Challenges were building HUD elements and connecting them to the lander.