Skip to content


Repository files navigation

Mingfei Jiang
COMPSCI 3GC3 Final Project
Magic Tower

Features Implemented
Bitmaps (Bitmap Characters)
Picking (Clicking on enemies to select)
.obj loading and drawing

W,A,S,D to move the character
LEFT CLICK on an enemy to view its stats
RIGHT CLICK to open the shop
PAGE UP and PAGE DOWN to zoom the camera in and out
Press r to reset the game.
Press q or esc to exit the program.

// more detailed comments and explainations in source code
	- contains global variables, opengl/glut functions as well as some utility functions
		- drawStrokeText // draws bitmap characters on screen
		- getWorldCoordinates // projects ray from where the user clicked to find the world coordinate
		- initalizeFloors // initailize Entity objects based on a layout and stores them
		- keyboard // glut keyboard func
		- special // glut special func
		- init // initialization
		- display // glut display func
		- mouse // glut mouse func
		- reshape // glut reshape func
		- FPS // glut timer func
		- callBackInit // initalize callback functions
		- menuProc // logic for menu
		- createOurMenu // create menu
		- main // main function

	- defines the layout of the flours using a vector of strings

	- defines the entity class and its subclasses, entities are objects in the game
	- important functions in each entity include interact and draw
	- interact processes any interact functionalities and returns a boolean for if the player is able to mode to that tile
	- draw applies and textures, materials, transformations and draws the objects
		- Entity
		- Player
		- Block
		- Stair
		- Item
		- Enemy

	- defines the Material class, which stores the material values and has a function set() to set the current material
	- initailizes all the materials to be used

	- defines the Vertex and Face structure, which is used to construct a model
	- defines the model class, which is a model loaded using an obj loader in the load() function
	- within the model class, a draw() function is defined, which draws the object using the faces, vertexes, uvs, and normals
		- Vertex // struct that store x y and z values
		- Face // struct that stores the indexes of vertexes, uvs, and normals
		- Model // a model loaded from .obj files

	- contains the loadPPM and loadTextures function
		- loadPPM // reads a ppm file and convert it to image data
		- loadTextures // initailizes the textures to be used

resources folder
	- the .obj files are models found online (through SketchUp 3D warehouse, BlendSwap, and the like), then modified to suit my needs and exported to .obj files using blender by me.
	- the ppm files are converted from pngs files that are either generated by me using the bake function in blender, or created by me using photoshop.


No description, website, or topics provided.






No releases published