| Description: The castle demo documented by Cod2Doc! This is a very basic example to show how to comment your code. Some Piece of code are commented (by RepeatUntil, sorry Mark ;), some are not (just to show that even without comment, nice documentation is produced). You can also see the bb source file from which the documentation was created. |
| Author: Mark Sibly |
| ATYPE_PLAYER | Global |
| Default value: 1 | |
| AATYPE_BULLET | Global |
| Default value: 2 | |
| AAATYPE_TARGET | Global |
| Default value: 3 | |
| FPS | Constant |
| Constant value: 30 | |
| n_trees | Constant |
| Description: Numbers of trees | |
| Constant value: 100 | |
| info1$ | Global |
| Default value: "Castle Demo" | |
| info2$ | Global |
| Default value: "Featuring dynamic terrain, sliding collisions," | |
| info3$ | Global |
| Default value: "transparency effects and an intelligent camera" | |
| info4$ | Global |
| Default value: "Arrow keys/A/Z to move, Space to jump, Left-Alt to fire" | |
| shoot | Global |
| Description: The sound when Marios fire | |
| Default value: Load3DSound( "sounds\shoot.wav" ) | |
| boom | Global |
| Description: The sound when the bullet hit something | |
| Default value: Load3DSound( "sounds\boom.wav" ) | |
| Player | Type |
| Field description: entity,model = Entity stuff anim_speed#,player_y#,roll# = Parameters of the entity | |
| Bullet | Type |
| Description: Type describing the bullet fired by Marios | |
| Field description: rot# = The rotation! sprite = The sprite! time_out = The time after which the bullet disappears | |
| Hole | Type |
| Description: Damage created by the bullet | |
| Field description: alpha#,sprite = The sprite and the alpha (yes, really!) | |
| TYPE_PLAYER | Constant |
| Constant value: 1 | |
| TYPE_BULLET | Constant |
| Constant value: 2 | |
| TYPE_TARGET | Constant |
| Constant value: 3 | |
| TYPE_SCENERY | Constant |
| Description: Variable used for the collision | |
| Constant value: 10 | |
| TYPE_TERRAIN | Constant |
| Description: Variable used for the collision | |
| Constant value: 11 | |
| water_level | Global |
| Default value: -98 | |
| light,castle,land,ground,water,sky | Global |
| spark_sprite,bull_sprite,player_model,hole_sprite,tree_sprite | Global |
| Description: Some sprites!! | |
| bull_x# | Global |
| Default value: 1.5 | |
| UpdateGame() | Function |
| Description: This function is the main one of this demo It calls UpdateHole(), UpdateBullet(), UpdateSpark() and UpdatePlayer() at each loop | |
| Return value: None | |
| UpdateHole(h.Hole) | Function |
| Parameters: h.Hole | |
| Return value: None | |
| CreatePlayer(x#,y#,z#) | Function |
| Description: Function used to create Marios | |
| Parameters: x# = the x location of the new entity y# = the y location of the new entity z# = the z location of the new entity | |
| Return value: the new type handle, See also: Player | |
| Example: Type Player Field entity,model ; Entity stuff Field anim_speed#,player_y#,roll# ; Parameters of the entity End Type ; How to use this function: player1.Player = CreatePlayer(0,10,0) | |
| CreateBullet(p.Player) | Function |
| Parameters: p.Player | |
| Return value: - | |
| UpdateBullet(b.Bullet) | Function |
| Description: Function updating the bullet. | |
| Parameters: b.Bullet | |
| Return value: None | |
| CreateSpark(b.Bullet) | Function |
| Parameters: b.Bullet | |
| Return value: - | |
| UpdateSpark(s.Spark) | Function |
| Parameters: s.Spark | |
| Return value: None | |
| UpdatePlayer(p.Player) | Function |
| Description: Function to update the player Handle the movement of Marios as well as the shot! | |
| Parameters: p.Player = the handle of the player type | |
| Return value: None | |
| CreateChaseCam(entity) | Function |
| Parameters: entity | |
| Return value: - | |
| UpdateChaseCam(c.ChaseCam) | Function |
| Parameters: c.ChaseCam | |
| Return value: None | |
| LoadEnviron(land_tex$,water_tex$,sky_tex$,height_map$) | Function |
| Description: Function creating the environ | |
| Parameters: land_tex$ = The texture of the land water_tex$ = The texture of the water sky_tex$ = Guess what? The texture of the sky height_map$ = The image file representing the height map | |
| Return value: None | |
| LoadSkyBox(file$) | Function |
| Parameters: file$ | |
| Return value: - | |
| Setup() | Function |
| Description: Function creating the whole world!! | |
| Return value: None | |
on 26 Jan 2004.