概述
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
' Physics constants
const ballWallBounce# = .7
const ballPinBounce# = .4
const ballBallBounce# = .7
const friction# = 0.005
const debug = false
const ballRadius# = 5.11
' Ball drawing constants
const xSlices = 20
const ySlices = 10
' Game structures
struc SProcessed
dim frame, ballIndex
endstruc
struc SBounds
dim x1, y1, x2, y2
endstruc
struc SBall
dim pos#(1)
dim vel#(1)
dim radius#
dim active ' True if still active. False = removed from game (e.g sunk)
dim moving
dim SProcessed processed
dim SBounds bounds
dim number ' 0 = cue ball, > 0 = number ball
dim angle#(3)(3)
dim roll#(3)(3), invRoll#(3)(3)
endstruc
struc SWall
dim pos#(1) ' Point where wall starts
dim pin ' Place an implied pin at pos#
dim T#(1) ' Unit tangent vector
dim N#(1) ' Unit normal vector
dim l# ' Length
dim sink ' True if ball sinks when it hits this wall
dim SProcessed wallProcessed
dim SProcessed pinProcessed
dim SBounds bounds
endstruc
struc SPlayer
dim name$
dim ballType ' (OVERS/UNDERS etc)
endstruc
' Ball drawing structures
struc SVertex
dim pos#(2)
dim norm#(2)
dim tex#(1)
endstruc
' Optimisation structures
' Table is grouped into a grid. Each square contains a list of
' walls, pins and balls contained inside it.
struc SWallLink
' Also used as a pin link
dim SWall &wall
dim SWallLink &nextLink
endstruc
struc SBallLink
dim SBall &ball
dim SBallLink &nextLink
endstruc
struc SGridCell
dim SWallLink &walls
dim SWallLink &pins
dim SBallLink &balls
dim SGridCell &nextCell
dim frame
endstruc
const gridXcells = 15, gridYcells = 23
最后
以上就是潇洒机器猫为你收集整理的c语言写台球游戏,OpenGL版 3D台球 (原创,Basic实现) 申精!的全部内容,希望文章能够帮你解决c语言写台球游戏,OpenGL版 3D台球 (原创,Basic实现) 申精!所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复