CodeBase Entries
Welcome to our CodeBase where you can search through DarkBASIC, DarkBASIC Professional and AppGameKit source code covering a wide range of topics from full games to demo effects to object loaders.
All registered users can submit their own code from their account page, so why not contribute?
| CodeBase Description | Category | |
|---|---|---|
|
This program is for finding the square root of any number you type in. Version:
Created: 7th Sep 2007 22:09
|
Math / Physics |
|
calculates the second endpoint of a line from one endpoint and the midpoint Version: 1.0
Created: 4th Sep 2007 19:30
|
Complete Applications |
|
calculates the midpoint and distance of 2 points Version: 1.0
Created: 4th Sep 2007 19:29
|
Complete Applications |
|
This will simply make a box with a border around it. Useful for Heads Up Displays or pop-up messages. Version: .1
Created: 1st Sep 2007 13:19
|
Basic 2D |
|
A free version of mine of game of life. I am not the first who write this game and I supose someone will do better than I. Version: 1.0
Created: 30th Aug 2007 20:56
|
Complete Applications |
|
a sidescroller submarine game Version: 1.0
Created: 30th Aug 2007 00:07
|
2D |
|
a fun little game of tic tac toe Version: 1.0
Created: 30th Aug 2007 00:04
|
2D |
|
a simple screen saver with the effect of text falling like the Matrix Movies Version: 1.0
Created: 28th Aug 2007 10:01
|
Complete Applications |
|
` This code was downloaded from The Game Creators ` It is reproduced here with full permission ` http://www.thegamecreators.com print "what is your name" input A$ print "hello ",A$, Print "How was your day?" input B$ Print "That sounds nice" wait 1000 Print "goodbye ",A$, wait 1000 Print A$," is a loser" wait 500 Version: 1.0
Created: 25th Aug 2007 04:01
|
Input / Output |
|
a simple locking screen saver that gives a virtual computer impression Version: 1.0
Created: 20th Aug 2007 11:46
|
Complete Applications |
|
A text positioner with size indicator! Version: 1.0
Created: 18th Aug 2007 17:05
|
Complete Applications |
|
This Function will Delimit Split a string Version: 1.0
Created: 17th Aug 2007 10:02
|
Complete Applications |
|
This code will tell the program if your mouse is hovering over a selected section or not, and whether it has clicked or not. Version: 1.0
Created: 15th Aug 2007 18:17
|
Complete Applications |
|
*** This code requires Dark Physics to run *** It is a little mesh saver that takes your object and saves it into a mesh text file for your game's physics. Pretty easy to code, but wanted to share for developers who don't want to code one. Version: 1.0
Created: 13th Aug 2007 03:20
|
Mesh |
|
Make your DBPro programs automatically detect the user's screen resolution. Version: 1.0
Created: 11th Aug 2007 16:49
|
Complete Applications |
|
Set DBPro to render in widescreen Version: 1.0
Created: 9th Aug 2007 07:39
|
Camera |
|
a simple full screen calculator Version: 1.6
Created: 6th Aug 2007 16:50
|
Math / Physics |
|
This code creates some simple random buttons, then checks if you click on one. It only signals a clicked button when you release the mouse button. this can be used as toolbar buttons, hud buttons, menubars (With tweaking) and anything else requiring buttons! Version: 1.0
Created: 6th Aug 2007 11:59
|
Miscellaneous |
|
this is a function to snap to grid, in any dimension. Version: 1.0
Created: 29th Jul 2007 15:45
|
Math / Physics |
|
This function grabs tiles out of a bitmap and assigns a number to them according to the order they are arranged in the source bitmap. It loads them into memory by get image and then you can just draw the tiles wherever using paste image. Version: 1.0
Created: 28th Jul 2007 12:48
|
Complete Applications |
|
make a slide show, easy Version: 1.0
Created: 23rd Jul 2007 15:17
|
Basic 2D |
|
Permet d'afficher les cartes et les résolutions disponibles sur le pc Version: 1.0
Created: 22nd Jul 2007 12:49
|
Display |
|
makes a matrix up to 100 squares by 100 squares (20,000 polygons). Can be called in real time. After you create it, you can just make a mesh and lock the vertexdata to adjust the height points to what you want. All verts are already welded. Version: 1.0
Created: 20th Jul 2007 23:45
|
Mesh |
|
import/export info via files (level editor) Please note that I didn't originally write this code and take no credit for it. The person who posted it didn't know who wrote it either so...Thank You mystery man!...or girl! Version: 1.0
Created: 20th Jul 2007 13:24
|
File Control |
|
this code was taken from another code base entry named Binary Fall Screensaver by Luke Brown, after playing around with the values in the code, i found that changing the value of sw# from 45 to 75 gives a more matrix feel, (i dont know whether this is just my computer but i thought id share it) Version: 1.0
Created: 19th Jul 2007 07:12
|
2D Effects |
|
In The Money is a 3 Reel Slot machine game. Version: 1.0
Created: 14th Jul 2007 15:20
|
Complete Applications |
|
A very very useful program which can load and position (in realtime) images onto the screen, and stores click coordinates into a text file. very easy to use, and very flexible. Use this for finding the coordinates of buttons, or where to place a picture onto the screen, or where to draw an object, ect. just load images onto the screen, and get clicking! please credit if used! www.freewebs.com/aralox Version: 1.0
Created: 13th Jul 2007 08:27
|
Complete Applications |
|
You're a cube and must run into the sphere to win all the while observing the nice ambient lighting. Version: 1.0
Created: 7th Jul 2007 00:10
|
Basic 3D |
|
simple way to start and finish a game or program Version: 1.0
Created: 30th Jun 2007 21:58
|
Input / Output |
|
REM Make_Memblock_Grid REM Created by Mike Shihrer aka Visigoth REM 06/28/2007 REM Free to use and modify, have fun! REM Demonstrates creating memblock meshes set display mode 1024,768,32 autocam off sync on sync rate 0 Global mem_pos position camera 0,20,0 rem return value is size of memblock in bytes, params are object ID,x width, z width, x units, z units mem_pos = make_memblock_grid(1,100,100,4,4) do display_memblock_data() move_camera1() sync loop function make_memblock_grid(id, x_width#, z_width#, x_segments, z_segments) unitwidth# = x_width# / x_segments unitheight# = z_width# / z_segments xpos# = 0 ypos# = 0 zpos# = 0 J = 1 d_color as dword d_color = RGB(255,255,255) rem calculate the size of the memblock we are going to need total_polys = (x_segments * z_segments) * 2 total_verts = total_polys * 3 memsize = (total_verts * 36) + 12 rem make a memblock of a size = memsize make memblock 1,memsize rem create the memblock header, which defines the FVF being used, in this case 338(mesh data,normals data, diffuse color, uv coords) last_mem_pos = make_memblock_meshheader(1,total_verts) rem call the make_memblock_triangle function and place the triangles rem first, it creates one triangle with the verts drawn from lower left, upper left, and lower right rem second, it creates the next triangle with the verts from upper left, upper right, and lower right rem then it just loops through drawing triangles until it reachs the x unit count, resets the I incrementer to startover rem and increments the zpos to start a new row of triangles rem change the RGB values above for different colors rem I assumed creating a horizontal matrix, and set the normals as such for I = 1 to x_segments last_mem_pos = make_memblock_triangle(1,last_mem_pos,xpos#,ypos#,zpos#,xpos#,ypos#,zpos# + unitheight#,xpos# + unitwidth#,ypos#,zpos#,0,1,0,0,1,1,d_color) last_mem_pos = make_memblock_triangle(1,last_mem_pos,xpos#,ypos#,zpos# + unitheight#,xpos# + unitwidth#,0,zpos# + unitheight#,xpos# + unitwidth#,ypos#,zpos#,0,0,1,0,1,1,d_color) inc xpos#, unitwidth# If J < z_segments If I = x_segments Inc J,1 inc zpos#,unitheight# xpos# = 0 I = 0 endif endif next I make mesh from memblock 1,1 delete memblock 1 make object id,1,0 rem uncomment this is you want to save the mesh, but beware, there seems to be a limit to how big a mesh you can save. Keep it under 80k polys rem save mesh "grid_" + str$(id) + ".x",1 delete mesh 1 endfunction last_mem_pos function make_memblock_triangle(id,mem_start,xpos1#,ypos1#,zpos1#,xpos2#,ypos2#,zpos2#,xpos3#,ypos3#,zpos3#,u1,v1,u2,v2,u3,v3,dif_clr as dword) a = mem_start rem mesh data format, each block is one vertice, three blocks is a triangle rem we could probably get fancy here and do some loops, but I think this is more readable rem we are just writing the values needed for each vertice in a triangle, into the memblock rem location. Every memblock position for this format takes up 4 bytes, so after every write, we just rem increment the memblock position by 4 rem vertice 1 write memblock float id,a,xpos1# : inc a,4 rem x pos of triangle write memblock float id,a,ypos1# : inc a,4 rem y pos of triangle write memblock float id,a,zpos1# : inc a,4 rem z pos of triangle write memblock float id,a,0 : inc a,4 rem x normals write memblock float id,a,1 : inc a,4 rem y normals write memblock float id,a,0 : inc a,4 rem z normals write memblock dword id,a,dif_clr : inc a,4 rem diffuse color write memblock float id,a,u1 : inc a,4 rem u write memblock float id,a,v1 : inc a,4 rem v rem vertice 2 write memblock float id,a,xpos2# : inc a,4 rem x pos of triangle write memblock float id,a,ypos2# : inc a,4 rem y pos of triangle write memblock float id,a,zpos2# : inc a,4 rem z pos of triangle write memblock float id,a,0 : inc a,4 rem x normals write memblock float id,a,1 : inc a,4 rem y normals write memblock float id,a,0 : inc a,4 rem z normals write memblock dword id,a,dif_clr : inc a,4 rem diffuse color write memblock float id,a,u2 : inc a,4 rem u write memblock float id,a,v2 : inc a,4 rem v rem vertice 3 write memblock float id,a,xpos3# : inc a,4 rem x pos of triangle write memblock float id,a,ypos3# : inc a,4 rem y pos of triangle write memblock float id,a,zpos3# : inc a,4 rem z pos of triangle write memblock float id,a,0 : inc a,4 rem x normals write memblock float id,a,1 : inc a,4 rem y normals write memblock float id,a,0 : inc a,4 rem z normals write memblock dword id,a,dif_clr : inc a,4 rem diffuse color write memblock float id,a,u3 : inc a,4 rem u write memblock float id,a,v3 : inc a,4 rem v rem a just returns the last memblock position, which we can use to get the overall size in bytes of the mesh endfunction a function make_memblock_meshheader(id,numVerts) rem header for mesh format rem sets up header for standard FVF mesh 338 rem we would change this to write a different FVF format if we wanted to write memblock dword id,0,338 write memblock dword id,4,36 write memblock dword id,8,numVerts endfunction 12 function move_camera1() if upkey() then move camera 1 if downkey()then move camera -1 if leftkey() then turn camera left 1 if rightkey() then turn camera right 1 endfunction function display_memblock_data() text 0,0,"Use Arrow Keys to Move" text 0,10,"Total Polys on screen: " + str$(statistic(1)) text 0,20,"Grid Size : " + str$(mem_pos) + " bytes" text 0,30,"FPS: " + str$(screen fps()) text 0,40,"Cam X Pos: " + str$(camera position x()) text 0,50,"Cam Y Pos: " + str$(camera position y()) text 0,60,"Cam Z Pos: " + str$(camera position z()) endfunction Version: 1.0
Created: 29th Jun 2007 03:46
|
Mesh |
