Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
resources
README.txt
entity.h
freeglut.dll
layout.h
magictower
magictower.exe
main.cpp
makefile
material.h
model.h
texture.h

README.txt

Mingfei Jiang
1320376
COMPSCI 3GC3 Final Project
Magic Tower

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

====================================
CONTROLS
====================================
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.

====================================
PROJECT STRUCTURE
====================================
// more detailed comments and explainations in source code
main.cpp
	- 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

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

entity.h
	- 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

material.h
	- 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

model.h
	- 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

texture.h
	- 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.
You can’t perform that action at this time.