This document discusses teaching game development using mini-games to teach programming and design concepts. It provides an overview of setting up the development environment and tools, basic game programming concepts like cameras and matrices, and approaches for simple games like Pong to teach core mechanics.
4. Workshop Target This is a discussion on the teaching of game development and will focus on the use of mini-games to teach game programming and game design. There will be no art.
22. 1000 Features (handout) unique value 0..1000 possible feature for your game -- focus on what you see, hear, and how to get it on the screen
23.
24. Cameras software metaphor // JFL 03 Oct 08 class Camera : public qe { public: chr name[16]; // name float fovyHalfRad; // in radians float nearClip; // near clipping plane float farClip; // far clipping plane float winWidth; // in pixels float winHeight; // in pixels float winWDivH; // window aspect ratio float nearHeight; // height at near plane float mat12[12]; // camera matrix int draw(); // draw-step function Camera(chr *name); // constructor }; // class Camera // setup -- happens once in mini-pong this->nearClip = 1; this->farClip = 500; this->fovyHalfRad = 0.5*((63*PI)/180.0); this->nearHeight = this->nearClip * MathTanf(this->fovyHalfRad); // camera matrix -- from world space into camera space SET3(pos,0,CAMERA_Y,0); // position of camera SET3(at,0,0,0); // where camera is looking at SET3(up,0,0,-1); // the camera's up direction qeCamLookAtM12f(this->mat12,pos,at,up); // camera mat // draw -- set every frame before you draw if(qeGetWindowSize(&this->winWidth,&this->winHeight)<0) bret(-2); // jump to function exit this->winWDivH=this->winWidth/this->winHeight; // set the PROJECTION matrix (the camera lens) glMatrixMode(GL_PROJECTION); glLoadIdentity(); float yy = this->nearHeight; float xx=this->nearHeight*this->winWDivH; glFrustum(-xx,xx,-yy,yy,this->nearClip,this->farClip); // MODELVIEW (position and orientation of the camera) glMatrixMode(GL_MODELVIEW); glLoadIdentity(); qeGLM12f(this->mat12); // set matrix