Game Design and Artificial Intelligence - Bournemouth University
Game Design and Artificial Intelligence - Bournemouth University
Game Design and Artificial Intelligence - Bournemouth University
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
<strong>Game</strong> <strong>Design</strong> <strong>and</strong> <strong>Artificial</strong> <strong>Intelligence</strong><br />
David Hopkins<br />
Fig 2.5 – an experiment with Qt working with OpenGL.<br />
Learning QT<br />
The game required quite a complex HUD, originally the method for this was going to be through<br />
creating textures for each ASCII character. However, further research into the QT software<br />
revealed another potential solution. QT offers a host of functions for creating some simple looking<br />
but effective HUD tools, including push buttons, radio buttons <strong>and</strong> tick boxes. It works quite<br />
simply through a slot <strong>and</strong> signal algorithm [macey01]. Whenever a message needs to be sent from<br />
an item, like a push button, it calls its signal function which is sent to one or more slots of other<br />
objects. The most useful element is that it can display opengl scenes in a window, with a frame of<br />
buttons on the outside. The only setback is that it does slow down the opengl program, but it would<br />
be a useful for small programs so would have worked quite nicely with the demo.<br />
In the end I decided to use the glText to display the information, though it is still my intention to<br />
use qt for a HUD which the player can interact with.<br />
Problems Encountered<br />
I originally setup the game to be able to switch between levels easily based on a selected global<br />
levelNumber using the following code:<br />
Switch(levelNumber)<br />
{<br />
case (1):<br />
{<br />
draw all objects level_1;<br />
}<br />
break;<br />
}<br />
The program had a strange bug when I attempted to start on a different level number <strong>and</strong> attempted<br />
to switch to the current level. The enemy ship speed seem to rocket for some unknown reason. I<br />
originally thought it could be to do with the timer, but as I disabled this at the beginning of the level<br />
Page 18 of 22