View on GitHub

Doomers RayCast API

Raycaster API

Team Doomers: Pavel Peev and Dane Ojala

UWB CSS452 with Prof. Kelvin Sung

Winter 2022

Home Tutorial Demos And Conclusion

Module Description:

Our API implements several classes that will be used together to allow users of the game engine to create 3D gameplay using a Raycasting engine. This API allows users of the game engine to quickly implement a retro-3D look, complete with texture support, camera movement, and more. Users can use a RCCamera in conjunction with a GridMap object of textured Tiles to implement basic games with raycast graphics. RCSpriteRenderable objects allow the user to add enemies, pickups, etc. that are rendered by the RCCamera as well.

API Classes Overview:

RCCamera

API Functions

RCCamera API:

RCCamera(wcPos, viewPortArray)

setViewPort(viewPortArray)

getViewPort()

getFOV()

setFOV(fov)

getResolution()

setResolution(res)

setRayCasterAngle(rot)

getRayCasterAngle()

moveRayCasterAngle(t)

setRayCasterPos(pos)

getRayCasterPos()

moveRayCasterForward(d)

Raycast(GridMap)

getRayCasts()

DrawRays()

getHorizonLine()

setHorizonLine(height)

moveHorizonLine(d)

getFishEye()

setFishEye(b)

getRayLengths()

GridMap API:

RC_GridMap(2DArrayOfTiles, xWidth, yWidth, xPos, yPos)

setTiles(2DArrayOfTiles)

setPosition(xPos, yPos)

getWidth()

setWidth(w)

getHeight()

setHeight(h)

setPosition()

getTileAtIndex(x,y)

getHeightInTiles()

getWidthInTiles()

getHeightOfTile()

getWidthOfTile()

Tile API:

Tile(topTexture, bottomTexture, leftTexture, rightTexture)

getTopTexture()

setTopTexture(tex)

getBottomTexture()

setBottomTexture(tex)

getLeftTexture()

setLeftTexture(tex)

getRightTexture()

setRightTexture(tex)

RCSpriteRenderable API:

RC_RenderableSprite(spriteRef)

getScaleX()

setScaleX(x)

getScaleY()

setScaleY(y)

getYOffset()

setYOffset(y)

draw(RC_Camera, position)