Code archives/3D Graphics - Misc/Commented 3D game framework (lite)
This code has been declared by its author to be Public Domain code.
Download source code
| |||||
This code provides a framework for new Blitz 3D programmers to start from. This version doesn't include the frame-limiting code, so you can see the 'basics' without that extra stuff getting in the way. If you're going to write a game though, use the frame-limited code! This is just for 'early learning' :) EDIT: There was some really outdated stuff in here! | |||||
; ------------------------------------------------------------------ ; GameCore -- support@blitzbasic.com ; ------------------------------------------------------------------ ; The basics of a frame-limited Blitz 3D game -- play about with it! ; ------------------------------------------------------------------ ; ------------------------------------------------------------------ ; Open 3D display mode ; ------------------------------------------------------------------ Graphics3D 640, 480 ; ------------------------------------------------------------------ ; Single camera setup ; ------------------------------------------------------------------ cam = CreateCamera () ; ------------------------------------------------------------------ ; General setup -- load and arrange objects, textures, etc here... ; ------------------------------------------------------------------ ; Create a cube and move it forward 5 'units', into view... box = CreateCube () MoveEntity box, 0, 0, 5 Repeat If KeyDown (203) TurnEntity box, 0, 0.5, 0 If KeyDown (205) TurnEntity box, 0, -0.5, 0 ; -------------------------------------------------------------- ; Draw 3D world ; -------------------------------------------------------------- RenderWorld ; -------------------------------------------------------------- ; Show result ; -------------------------------------------------------------- Flip Until KeyHit (1) End |
Comments
None.
Code Archives Forum