2618.bb
; ID: 2618
; Author: Ion
; Date: 2009-11-30 13:27:20
; Title: Fish!
; Description: A pseudo-fish mesh in code

;********************************
; Fishes! by Ion
; Copyright (c) 2009 E.Sandberg (Ion)
; This code is free to the public domain
;
;********************************

;Funny variables
Type TFish
Field Entity, Yaw#, Speed#
End Type
Global fishes.TFish[999]

;Initialize
Graphics3D 1024, 768, 16, 2
SetBuffer BackBuffer()
SeedRnd MilliSecs()
WireFrame False
HidePointer

;A little light
light = CreateLight()

;Set up the camera
camera = CreateCamera()
campiv = CreatePivot()
EntityParent camera, campiv
PositionEntity camera, 0, 50, -50
RotateEntity camera, 45, 0, 0
CameraClsColor camera, 64, 64, 255
CameraFogMode camera, 1
CameraFogColor camera, 64, 64, 255
CameraFogRange camera, 10, 100

;Create 100 fishes!
For i = 0 To 99
f.TFish = New TFish
f\Entity = CreateFish()
f\Yaw = Rnd(-1, 1)
f\Speed = Rnd(0.1, 0.5)
PositionEntity f\Entity, Rand(-50, 50), Rand(-50, 50), Rand(-50, 50)
RotateEntity f\Entity, 0, Rand(0, 360), Rand(-45, 45)
fishes[i] = f
Next

;Gameloop
While Not KeyHit(1)
TurnEntity campiv, 0, -MouseXSpeed(), 0
For i = 0 To 99
AnimateFish(fishes[i]\Entity, an + 90*i)
MoveEntity fishes[i]\Entity, fishes[i]\Speed, 0, 0
TurnEntity fishes[i]\Entity, 0, fishes[i]\Yaw, 0
Next

an = an + Rnd(10, 20)
an = an Mod 360

MoveMouse 320, 240
RenderWorld
Flip
Wend

;Create a fish!
Function CreateFish()
mesh = CreateMesh()
surf = CreateSurface(mesh)

v0 = AddVertex(surf, 1, 0, 0)
v1 = AddVertex(surf, 0, -0.5, 0)
v2 = AddVertex(surf, 0, 0.5, 0)
v3 = AddVertex(surf, -1, 0, -0.5)
v4 = AddVertex(surf, -1, 0, 0.5)
v5 = AddVertex(surf, -2, 0.5, 0)
v6 = AddVertex(surf, Rand(-2.5, -1), Rand(1, 1.2), 0)
v7 = AddVertex(surf, -2, -0.5, 0)
v8 = AddVertex(surf, -3, -0.8, 0)
v9 = AddVertex(surf, -3.5, -0.5, 0)
v10 = AddVertex(surf, -3.5, 1.5, 0)
v11 = AddVertex(surf, -1, Rand(0.5, -1), 0)

;Head
AddTriangle surf, v3, v2, v0
AddTriangle surf, v0, v2, v4
AddTriangle surf, v1, v3, v0
AddTriangle surf, v0, v4, v1
AddTriangle surf, v3, v5, v2
AddTriangle surf, v2, v5, v4

;Fin
AddTriangle surf, v5, v6, v2
AddTriangle surf, v2, v6, v5

;Body
AddTriangle surf, v3, v7, v5
AddTriangle surf, v5, v7, v4
AddTriangle surf, v3, v1, v7
AddTriangle surf, v7, v1, v4

;Back-fin
AddTriangle surf, v7, v10, v5
AddTriangle surf, v5, v10, v7
AddTriangle surf, v7, v9, v10
AddTriangle surf, v10, v9, v7
AddTriangle surf, v8, v9, v7
AddTriangle surf, v7, v9, v8

;Under-fin
AddTriangle surf, v11, v7, v1
AddTriangle surf, v1, v7, v11

UpdateNormals mesh

;Color fish!
For i = 0 To 10
VertexColor surf, i, Rnd(0, 255), Rnd(0, 255), Rnd(0, 255)
Next
EntityFX mesh, 2
Return mesh
End Function

;Stops a fish's animation!
Function StopFish(mesh)
surf = GetSurface(mesh, 1)
VertexCoords surf, 10, VertexX(surf, 10), VertexY(surf, 10), 0
VertexCoords surf, 9, VertexX(surf, 9), VertexY(surf, 9), 0
VertexCoords surf, 8, VertexX(surf, 8), VertexY(surf, 8), 0
VertexCoords surf, 6, VertexX(surf, 6), VertexY(surf, 6), 0
VertexCoords surf, 5, VertexX(surf, 5), VertexY(surf, 5), 0
VertexCoords surf, 7, VertexX(surf, 7), VertexY(surf, 7), 0
VertexCoords surf, 11, VertexX(surf, 11), VertexY(surf, 11), 0

VertexCoords surf, 3, VertexX(surf, 3), VertexY(surf, 3), -0.5
VertexCoords surf, 4, VertexX(surf, 4), VertexY(surf, 4), 0.5
VertexCoords surf, 2, VertexX(surf, 2), VertexY(surf, 2), 0
VertexCoords surf, 1, VertexX(surf, 1), VertexY(surf, 1), 0
End Function

;Animate a fish!
Function AnimateFish(mesh, an#)
surf = GetSurface(mesh, 1)
VertexCoords surf, 10, VertexX(surf, 10), VertexY(surf, 10), Sin(an)*0.5
VertexCoords surf, 9, VertexX(surf, 9), VertexY(surf, 9), Sin(an)*0.5
VertexCoords surf, 8, VertexX(surf, 8), VertexY(surf, 8), Sin(an)*0.5
VertexCoords surf, 6, VertexX(surf, 6), VertexY(surf, 6), Cos(an)*-0.2
VertexCoords surf, 5, VertexX(surf, 5), VertexY(surf, 5), Cos(an)*-0.2
VertexCoords surf, 7, VertexX(surf, 7), VertexY(surf, 7), Cos(an)*-0.2
VertexCoords surf, 11, VertexX(surf, 11), VertexY(surf, 11), Cos(an)*-0.2

VertexCoords surf, 3, VertexX(surf, 3), VertexY(surf, 3), -0.5+Cos(an)*-0.1
VertexCoords surf, 4, VertexX(surf, 4), VertexY(surf, 4), 0.5+Cos(an)*-0.1
VertexCoords surf, 2, VertexX(surf, 2), VertexY(surf, 2), Sin(an)*-0.1
VertexCoords surf, 1, VertexX(surf, 1), VertexY(surf, 1), Sin(an)*-0.1
End Function

3d fpg.bb
Graphics 600,666,0,2
AppTitle "game v1"
Global x,y,a

Print "welcome to game"
WaitKey
n=Rand(1,10)
While Int(Input$("guess the no. 1*-10 "))<>n
Print "incorrect"
Wend
Print "correct"
WaitKey

3d nail.bb
Graphics3D 640,400,0,2
SetBuffer BackBuffer()
nail=CreatePivot()
cube=CreateCube()
MoveEntity cube,0,-7,0
EntityParent cube,nail
MoveEntity nail,0,5,0
TurnEntity CreateLight(),80,0,0
MoveEntity CreateCamera(),0,0,-10
xd#=0.1
x#=-3.3
Repeat
TurnEntity nail,0,0.2,x
x=x+xd
If x<-3.3 Or x>3.3 Then xd=-xd
RenderWorld
Flip
Forever

3d.bb
Graphics3D 640,400
SetBuffer BackBuffer()
nail=CreatePivot()
cube=CreateCube()
MoveEntity cube,0,-7,0
EntityParent cube,nail
MoveEntity nail,0,5,0
TurnEntity CreateLight(),80,0,0
MoveEntity CreateCamera(),0,0,-10
xd#=0.1
x#=-3.3
Repeat
TurnEntity nail,0,0.2,x
x=x+xd
If x<-3.3 Or x>3.3 Then xd=-xd
RenderWorld
Flip
Forever

LOD.bb
Graphics3D 800,600,32,2
SetBuffer BackBuffer()

camera = CreateCamera()
PositionEntity camera,0,0,-3

WireFrame 1
sph = CreateSphere()

Texture = CreateRandomTexture(128)

EntityTexture sph,texture

While Not KeyHit(1)
If KeyHit(17) Then wire = 1-wire:WireFrame wire

If KeyHit(200) And LOD < 3 Then sph = LOD_Divide(sph):EntityTexture sph,texture:LOD = LOD + 1
If KeyHit(208) And LOD > 0 Then sph = LOD_Reduce(sph):EntityTexture sph,texture:LOD = LOD - 1
RenderWorld
Locate 0,0 : Color 255,255,255
Print "Triangle Count: " + TrisRendered()
Print "Press Up Arrow to Increase LOD"
Print "Press Down Arrow to Decrease LOD"
Print "Press W for Wire Frame"
Flip
Wend



Function LOD_Divide(Mesh)

Local DestMesh,Surf,RefSurf,Cnt,A
Local X1#,Y1#,Z1#,U1#,V1#
Local X2#,Y2#,Z2#,U2#,V2#
Local X3#,Y3#,Z3#,U3#,V3#
Local X4#,Y4#,Z4#,U4#,V4#
Local X5#,Y5#,Z5#,U5#,V5#
Local X6#,Y6#,Z6#,U6#,V6#
Local Vert1,Vert2,Vert3,Vert4,Vert5,Vert6

DestMesh = CreateMesh()
Surf = CreateSurface(DestMesh)
RefSurf = GetSurface(Mesh,CountSurfaces(Mesh))
Cnt = CountTriangles(RefSurf)

For A = 0 To Cnt-1
X1#=VertexX(RefSurf,TriangleVertex(RefSurf,A,0))
Y1#=VertexY(RefSurf,TriangleVertex(RefSurf,A,0))
Z1#=VertexZ(RefSurf,TriangleVertex(RefSurf,A,0))
U1#=VertexU(RefSurf,TriangleVertex(RefSurf,A,0))
V1#=VertexV(RefSurf,TriangleVertex(RefSurf,A,0))
X2#=VertexX(RefSurf,TriangleVertex(RefSurf,A,1))
Y2#=VertexY(RefSurf,TriangleVertex(RefSurf,A,1))
Z2#=VertexZ(RefSurf,TriangleVertex(RefSurf,A,1))
U2#=VertexU(RefSurf,TriangleVertex(RefSurf,A,1))
V2#=VertexV(RefSurf,TriangleVertex(RefSurf,A,1))
X3#=VertexX(RefSurf,TriangleVertex(RefSurf,A,2))
Y3#=VertexY(RefSurf,TriangleVertex(RefSurf,A,2))
Z3#=VertexZ(RefSurf,TriangleVertex(RefSurf,A,2))
U3#=VertexU(RefSurf,TriangleVertex(RefSurf,A,2))
V3#=VertexV(RefSurf,TriangleVertex(RefSurf,A,2))

X4#=(X1+X2)/2.0
Y4#=(Y1+Y2)/2.0
Z4#=(Z1+Z2)/2.0
U4#=(U1+U2)/2.0
V4#=(V1+V2)/2.0

X5#=(X2+X3)/2.0
Y5#=(Y2+Y3)/2.0
Z5#=(Z2+Z3)/2.0
U5#=(U2+U3)/2.0
V5#=(V2+V3)/2.0

X6#=(X3+X1)/2.0
Y6#=(Y3+Y1)/2.0
Z6#=(Z3+Z1)/2.0
U6#=(U3+U1)/2.0
V6#=(V3+V1)/2.0

Vert1 = AddVertex (Surf,X1,Y1,Z1,U1,V1) ;Original
Vert2 = AddVertex (Surf,X2,Y2,Z2,U2,V2) ;Original
Vert3 = AddVertex (Surf,X3,Y3,Z3,U3,V3) ;Original

Vert4 = AddVertex (Surf,X4,Y4,Z4,U4,V4)
Vert5 = AddVertex (Surf,X5,Y5,Z5,U5,V5)
Vert6 = AddVertex (Surf,X6,Y6,Z6,U6,V6)

AddTriangle Surf,Vert1,Vert4,Vert6
AddTriangle Surf,Vert2,Vert5,Vert4
AddTriangle Surf,Vert3,Vert6,Vert5
AddTriangle Surf,Vert4,Vert5,Vert6

Next
UpdateNormals DestMesh
FreeEntity Mesh
Return DestMesh
End Function

Function LOD_Reduce(Mesh)

Local Destmesh,Surf,RefSurf,Cnt,A
Local X1#,Y1#,Z1#,U1#,V1#
Local X2#,Y2#,Z2#,U2#,V2#
Local X3#,Y3#,Z3#,U3#,V3#
Local Vert1,Vert2,Vert3

Destmesh=CreateMesh()
Surf=CreateSurface(Destmesh)
RefSurf=GetSurface(Mesh,CountSurfaces(Mesh))
Cnt=CountTriangles(RefSurf)
For A=0 To Cnt-1 Step 4
X1#=VertexX(RefSurf,TriangleVertex(RefSurf,A+0,0))
Y1#=VertexY(RefSurf,TriangleVertex(RefSurf,A+0,0))
Z1#=VertexZ(RefSurf,TriangleVertex(RefSurf,A+0,0))
U1#=VertexU(RefSurf,TriangleVertex(RefSurf,A+0,0))
V1#=VertexV(RefSurf,TriangleVertex(RefSurf,A+0,0))

X2#=VertexX(RefSurf,TriangleVertex(RefSurf,A+1,0))
Y2#=VertexY(RefSurf,TriangleVertex(RefSurf,A+1,0))
Z2#=VertexZ(RefSurf,TriangleVertex(RefSurf,A+1,0))
U2#=VertexU(RefSurf,TriangleVertex(RefSurf,A+1,0))
V2#=VertexV(RefSurf,TriangleVertex(RefSurf,A+1,0))

X3#=VertexX(RefSurf,TriangleVertex(RefSurf,A+2,0))
Y3#=VertexY(RefSurf,TriangleVertex(RefSurf,A+2,0))
Z3#=VertexZ(RefSurf,TriangleVertex(RefSurf,A+2,0))
U3#=VertexU(RefSurf,TriangleVertex(RefSurf,A+2,0))
V3#=VertexV(RefSurf,TriangleVertex(RefSurf,A+2,0))

Vert1 = AddVertex (Surf,X1,Y1,Z1,U1,V1) ;Original
Vert2 = AddVertex (Surf,X2,Y2,Z2,U2,V2) ;Original
Vert3 = AddVertex (Surf,X3,Y3,Z3,U3,V3) ;Original
AddTriangle Surf,Vert1,Vert2,Vert3
Next
UpdateNormals Destmesh
FreeEntity Mesh
Return Destmesh

End Function


Function CreateRandomTexture(size)
t = CreateTexture(size,size)

SetBuffer TextureBuffer(t)
For i = 0 To 99
Color Rand(255),Rand(255),Rand(255)
Rect Rand(size),Rand(size),Rand(size),Rand(size),0
Next

Return t

End Function

arc2.bb
graphics 555,555,0,2
plot 240, 328
plot 237, 324
plot 237, 324
plot 233, 321
plot 233, 321
plot 230, 314
plot 230, 314
plot 230, 310
plot 226, 307
plot 226, 307
plot 226, 303
plot 223, 296
plot 219, 293
plot 219, 289
plot 216, 289
plot 216, 286
plot 216, 282
plot 212, 279
plot 212, 275
plot 212, 272
plot 212, 265
plot 212, 261
plot 212, 258
plot 212, 254
plot 212, 251
plot 212, 247
plot 212, 244
plot 212, 240
plot 212, 233
plot 212, 230
plot 215, 226
plot 215, 223
plot 215, 219
plot 219, 216
plot 219, 212
plot 219, 209
plot 219, 205
plot 219, 202
plot 222, 198
plot 222, 198
plot 222, 195
plot 222, 191
plot 222, 188
plot 226, 181
plot 226, 177
plot 226, 174
plot 226, 170
plot 229, 167
plot 229, 167
plot 229, 163
plot 233, 160
plot 233, 156
plot 236, 149
plot 240, 146
plot 240, 142
plot 240, 139
plot 243, 139
plot 243, 135
plot 243, 132
plot 250, 128
plot 254, 125
plot 257, 121
plot 257, 121
plot 261, 121
plot 264, 121
plot 268, 118
plot 268, 118
plot 271, 118
plot 278, 118
plot 282, 118
plot 285, 118
plot 289, 118
plot 292, 118
plot 296, 118
plot 299, 118
plot 303, 118
plot 306, 118
plot 310, 118
plot 313, 118
plot 317, 118
plot 320, 118
plot 324, 121
plot 327, 121
plot 331, 121
plot 334, 124
plot 338, 124
plot 341, 124
plot 345, 124
plot 345, 128
plot 348, 128
plot 352, 128
plot 355, 131
plot 359, 131
plot 359, 135
plot 362, 135
plot 366, 135
plot 366, 138
plot 373, 142
plot 373, 145
plot 376, 145
plot 376, 149
plot 380, 149
plot 383, 156
plot 387, 159
plot 390, 163
plot 390, 166
plot 394, 170
plot 394, 173
plot 397, 173
plot 397, 177
plot 401, 184
plot 401, 187
plot 401, 191
plot 401, 194
plot 401, 198
plot 401, 201
plot 401, 212
plot 401, 215
plot 401, 219
plot 401, 222
plot 401, 226
plot 401, 233
plot 401, 236
plot 401, 240
plot 401, 250
plot 401, 254
plot 401, 257
plot 398, 261
plot 398, 261
plot 398, 264
plot 398, 268
plot 394, 271
plot 394, 271
plot 391, 275
plot 391, 275
plot 391, 278
plot 387, 282
plot 384, 285
plot 384, 285
plot 384, 289
plot 380, 292
plot 377, 296
plot 377, 296
plot 373, 296
plot 373, 299
plot 370, 303
plot 370, 306
plot 366, 306
plot 363, 310
plot 359, 310
plot 359, 313
plot 356, 317
plot 352, 317
plot 349, 317
plot 349, 320
plot 345, 320
plot 342, 324
plot 338, 324
plot 335, 327
plot 335, 327
plot 331, 327
plot 328, 327
plot 321, 327
plot 317, 327
plot 314, 327
plot 310, 327
plot 307, 327
plot 303, 327
plot 300, 327
plot 296, 327
plot 293, 327
plot 289, 327
plot 286, 327
plot 282, 327
plot 279, 327
plot 275, 327
plot 272, 327
plot 268, 327
plot 265, 327
plot 261, 324
plot 258, 324
plot 254, 324
plot 251, 324
plot 247, 324
plot 244, 324
plot 244, 321
plot 240, 321
plot 237, 317
plot 271, 209
plot 271, 205
plot 271, 202
plot 271, 195
plot 271, 191
plot 271, 188
plot 271, 184
plot 271, 181
plot 271, 177
plot 271, 174
plot 271, 170
plot 275, 170
plot 275, 167
plot 278, 167
plot 282, 167
plot 285, 167
plot 289, 167
plot 292, 167
plot 296, 167
plot 299, 167
plot 306, 167
plot 310, 167
plot 313, 167
plot 313, 170
plot 317, 173
plot 317, 177
plot 317, 180
plot 317, 184
plot 317, 187
plot 317, 191
plot 314, 191
plot 314, 194
plot 310, 198
plot 307, 198
plot 307, 201
plot 303, 201
plot 300, 201
plot 300, 205
plot 296, 205
plot 293, 205
plot 289, 205
plot 286, 205
plot 282, 205
plot 279, 205
plot 275, 205
plot 275, 202
plot 272, 202
plot 268, 202
plot 345, 212
plot 345, 209
plot 345, 202
plot 342, 202
plot 342, 198
plot 338, 195
plot 338, 191
plot 338, 188
plot 338, 184
plot 338, 181
plot 338, 177
plot 341, 177
plot 345, 177
plot 348, 177
plot 352, 177
plot 355, 177
plot 359, 177
plot 362, 177
plot 366, 177
plot 366, 180
plot 366, 184
plot 366, 187
plot 366, 191
plot 366, 194
plot 366, 198
plot 363, 201
plot 363, 201
plot 363, 205
plot 359, 205
plot 356, 205
plot 356, 208
plot 352, 208
plot 349, 208
plot 345, 208
waitkey

ceruza.bb
graphics 555,555,0,2
plot 112, 317
plot 112, 321
plot 109, 324
plot 109, 328
plot 105, 331
plot 102, 335
plot 102, 338
plot 102, 342
plot 102, 345
plot 98, 345
plot 98, 349
plot 98, 352
plot 95, 352
plot 95, 356
plot 91, 359
plot 91, 363
plot 88, 366
plot 88, 370
plot 88, 373
plot 88, 377
plot 88, 380
plot 91, 384
plot 94, 384
plot 98, 384
plot 98, 387
plot 105, 387
plot 108, 387
plot 108, 391
plot 112, 391
plot 115, 391
plot 119, 391
plot 122, 391
plot 126, 391
plot 129, 391
plot 133, 391
plot 136, 391
plot 140, 391
plot 143, 391
plot 147, 391
plot 150, 388
plot 154, 388
plot 157, 388
plot 161, 384
plot 164, 384
plot 164, 381
plot 168, 377
plot 168, 374
plot 171, 374
plot 171, 370
plot 175, 367
plot 175, 367
plot 178, 363
plot 178, 360
plot 182, 360
plot 182, 356
plot 185, 356
plot 185, 353
plot 189, 353
plot 189, 349
plot 192, 346
plot 192, 346
plot 196, 342
plot 196, 342
plot 196, 339
plot 199, 339
plot 199, 332
plot 203, 328
plot 206, 328
plot 206, 325
plot 210, 321
plot 210, 321
plot 210, 318
plot 213, 318
plot 213, 314
plot 217, 314
plot 217, 307
plot 220, 307
plot 224, 304
plot 227, 300
plot 234, 297
plot 238, 297
plot 241, 293
plot 241, 293
plot 245, 293
plot 248, 290
plot 248, 290
plot 255, 286
plot 255, 286
plot 259, 286
plot 266, 279
plot 269, 276
plot 269, 272
plot 273, 269
plot 276, 265
plot 276, 265
plot 276, 262
plot 280, 258
plot 283, 258
plot 287, 255
plot 290, 248
plot 290, 248
plot 294, 244
plot 297, 241
plot 301, 237
plot 304, 234
plot 304, 234
plot 308, 230
plot 308, 230
plot 315, 227
plot 315, 227
plot 318, 223
plot 318, 220
plot 322, 216
plot 322, 216
plot 325, 213
plot 329, 213
plot 329, 209
plot 332, 209
plot 336, 206
plot 336, 206
plot 339, 202
plot 339, 202
plot 339, 199
plot 343, 199
plot 346, 199
plot 346, 195
plot 350, 195
plot 353, 192
plot 357, 188
plot 360, 185
plot 364, 185
plot 367, 181
plot 367, 181
plot 371, 178
plot 374, 174
plot 381, 171
plot 381, 167
plot 385, 167
plot 385, 164
plot 388, 164
plot 392, 160
plot 395, 160
plot 395, 157
plot 399, 157
plot 402, 157
plot 402, 153
plot 406, 153
plot 406, 150
plot 409, 150
plot 409, 146
plot 413, 146
plot 416, 143
plot 416, 139
plot 420, 136
plot 420, 132
plot 420, 129
plot 423, 125
plot 423, 122
plot 423, 118
plot 423, 115
plot 427, 108
plot 427, 104
plot 427, 101
plot 430, 101
plot 430, 97
plot 430, 94
plot 430, 90
plot 430, 87
plot 430, 83
plot 434, 80
plot 434, 76
plot 434, 73
plot 434, 69
plot 434, 66
plot 434, 62
plot 434, 59
plot 434, 55
plot 434, 52
plot 434, 48
plot 434, 45
plot 434, 41
plot 434, 38
plot 434, 34
plot 434, 31
plot 437, 27
plot 437, 24
plot 441, 24
plot 441, 20
plot 444, 20
plot 444, 17
plot 444, 13
plot 448, 13
plot 448, 10
plot 445, 10
plot 445, 13
plot 441, 13
plot 438, 13
plot 438, 16
plot 434, 16
plot 431, 16
plot 431, 20
plot 427, 20
plot 424, 20
plot 424, 23
plot 420, 23
plot 420, 27
plot 417, 27
plot 413, 27
plot 410, 27
plot 406, 30
plot 403, 30
plot 399, 30
plot 396, 34
plot 396, 34
plot 392, 34
plot 389, 37
plot 385, 37
plot 382, 37
plot 378, 37
plot 375, 37
plot 371, 37
plot 371, 41
plot 368, 41
plot 364, 41
plot 361, 41
plot 357, 44
plot 357, 44
plot 354, 44
plot 350, 44
plot 347, 48
plot 343, 48
plot 340, 48
plot 340, 51
plot 336, 55
plot 336, 55
plot 333, 58
plot 329, 62
plot 329, 62
plot 326, 65
plot 322, 69
plot 322, 69
plot 319, 69
plot 319, 72
plot 315, 72
plot 308, 79
plot 308, 79
plot 308, 83
plot 305, 83
plot 301, 86
plot 301, 86
plot 298, 90
plot 294, 93
plot 291, 97
plot 287, 97
plot 284, 100
plot 284, 104
plot 280, 104
plot 280, 107
plot 277, 107
plot 273, 111
plot 273, 111
plot 273, 114
plot 270, 114
plot 270, 118
plot 266, 121
plot 263, 125
plot 259, 125
plot 259, 128
plot 256, 128
plot 256, 132
plot 252, 132
plot 252, 135
plot 249, 135
plot 245, 139
plot 245, 142
plot 242, 142
plot 242, 146
plot 238, 146
plot 238, 149
plot 228, 156
plot 228, 160
plot 224, 160
plot 224, 163
plot 221, 163
plot 221, 167
plot 217, 170
plot 214, 174
plot 214, 177
plot 207, 184
plot 203, 188
plot 203, 191
plot 200, 191
plot 196, 195
plot 196, 198
plot 193, 198
plot 193, 202
plot 193, 205
plot 189, 209
plot 189, 209
plot 186, 212
plot 186, 216
plot 182, 216
plot 179, 219
plot 179, 223
plot 175, 223
plot 175, 226
plot 172, 230
plot 172, 230
plot 168, 233
plot 165, 233
plot 165, 237
plot 161, 240
plot 161, 240
plot 161, 244
plot 158, 247
plot 158, 251
plot 154, 251
plot 151, 254
plot 151, 254
plot 151, 258
plot 147, 258
plot 147, 261
plot 144, 265
plot 144, 265
plot 144, 268
plot 140, 268
plot 140, 272
plot 140, 275
plot 137, 275
plot 137, 279
plot 137, 282
plot 133, 282
plot 133, 286
plot 130, 289
plot 130, 293
plot 126, 296
plot 126, 296
plot 126, 300
plot 123, 303
plot 123, 307
plot 119, 307
plot 119, 310
plot 119, 314
plot 119, 317
plot 119, 321
plot 122, 321
plot 122, 324
plot 126, 324
plot 129, 324
plot 129, 328
plot 133, 328
plot 136, 328
plot 136, 331
plot 140, 335
plot 143, 338
plot 143, 338
plot 147, 342
plot 147, 345
plot 150, 345
plot 150, 349
plot 154, 349
plot 154, 352
plot 154, 356
plot 157, 356
plot 161, 356
plot 164, 356
plot 164, 359
plot 168, 359
plot 171, 359
plot 175, 363
plot 178, 366
plot 140, 332
plot 140, 328
plot 143, 325
plot 147, 321
plot 147, 321
plot 147, 314
plot 150, 314
plot 150, 311
plot 150, 307
plot 154, 304
plot 157, 300
plot 157, 297
plot 157, 293
plot 161, 286
plot 161, 286
plot 168, 279
plot 168, 279
plot 168, 276
plot 171, 272
plot 175, 272
plot 175, 269
plot 178, 265
plot 182, 262
plot 182, 262
plot 185, 262
plot 189, 255
plot 192, 251
plot 196, 248
plot 196, 244
plot 199, 241
plot 203, 237
plot 203, 237
plot 203, 234
plot 206, 234
plot 210, 230
plot 213, 227
plot 213, 223
plot 217, 223
plot 217, 220
plot 220, 220
plot 220, 216
plot 224, 216
plot 227, 213
plot 231, 209
plot 231, 209
plot 238, 206
plot 238, 206
plot 238, 202
plot 245, 199
plot 248, 199
plot 248, 195
plot 252, 192
plot 255, 192
plot 259, 188
plot 259, 188
plot 262, 185
plot 266, 185
plot 273, 181
plot 273, 178
plot 276, 178
plot 280, 174
plot 283, 174
plot 287, 171
plot 287, 171
plot 290, 171
plot 294, 167
plot 297, 167
plot 301, 164
plot 308, 160
plot 308, 157
plot 311, 157
plot 315, 153
plot 315, 153
plot 318, 150
plot 318, 150
plot 322, 146
plot 325, 146
plot 325, 143
plot 329, 143
plot 329, 139
plot 332, 136
plot 336, 132
plot 336, 129
plot 339, 125
plot 339, 122
plot 339, 118
plot 343, 118
plot 343, 115
plot 343, 111
plot 346, 108
plot 346, 104
plot 350, 104
plot 350, 101
plot 350, 97
plot 353, 97
plot 340, 51
plot 340, 55
plot 340, 58
plot 340, 62
plot 340, 65
plot 340, 69
plot 340, 72
plot 340, 76
plot 340, 79
plot 343, 79
plot 343, 83
plot 343, 86
plot 343, 90
plot 343, 93
plot 343, 97
plot 346, 97
plot 346, 100
plot 346, 104
plot 350, 107
plot 353, 107
plot 357, 111
plot 357, 111
plot 360, 114
plot 364, 114
plot 364, 118
plot 367, 118
plot 371, 118
plot 371, 121
plot 374, 121
plot 378, 121
plot 378, 125
plot 381, 128
plot 385, 128
plot 388, 128
plot 388, 132
plot 392, 132
plot 395, 132
plot 399, 135
plot 399, 135
plot 402, 135
plot 409, 135
plot 413, 135
plot 416, 135
plot 382, 132
plot 378, 135
plot 375, 135
plot 371, 139
plot 364, 142
plot 361, 146
plot 361, 146
plot 354, 149
plot 354, 149
plot 343, 156
plot 340, 160
plot 333, 163
plot 329, 163
plot 326, 167
plot 326, 167
plot 322, 170
plot 319, 170
plot 315, 174
plot 312, 177
plot 305, 181
plot 301, 181
plot 301, 184
plot 298, 184
plot 294, 188
plot 294, 191
plot 287, 195
plot 287, 195
plot 287, 198
plot 284, 202
plot 280, 205
plot 277, 209
plot 273, 212
plot 266, 219
plot 266, 219
plot 263, 223
plot 259, 226
plot 256, 226
plot 252, 230
plot 252, 230
plot 249, 233
plot 249, 233
plot 245, 237
plot 242, 240
plot 242, 240
plot 238, 240
plot 231, 244
plot 228, 247
plot 224, 251
plot 224, 251
plot 221, 251
plot 217, 251
plot 217, 254
plot 214, 254
plot 214, 258
plot 210, 258
plot 210, 261
plot 207, 265
plot 203, 268
plot 203, 272
plot 200, 272
plot 200, 275
plot 196, 279
plot 196, 279
plot 196, 282
plot 193, 289
plot 189, 289
plot 189, 293
plot 189, 296
plot 186, 296
plot 186, 300
plot 186, 303
plot 182, 303
plot 182, 307
plot 179, 310
plot 179, 314
plot 175, 314
plot 175, 317
plot 175, 321
plot 172, 321
plot 172, 324
plot 168, 328
plot 168, 331
plot 165, 331
plot 161, 335
plot 161, 338
plot 161, 342
plot 161, 345
plot 158, 345
plot 158, 349
plot 158, 352
plot 158, 356
plot 112, 328
plot 112, 331
plot 112, 335
plot 115, 335
plot 119, 338
plot 122, 342
plot 122, 342
plot 126, 342
plot 126, 345
plot 129, 345
plot 133, 349
plot 136, 349
plot 140, 352
plot 143, 356
plot 147, 356
plot 147, 359
plot 150, 359
plot 150, 363
plot 154, 363
plot 154, 366
plot 157, 366
plot 161, 366
plot 161, 370
plot 164, 370
plot 168, 370
plot 423, 27
plot 423, 30
plot 427, 30
plot 427, 34
plot 427, 37
plot 430, 37
plot 256, 244
plot 259, 244
plot 259, 247
plot 259, 251
plot 262, 251
plot 262, 254
plot 266, 254
plot 266, 258
plot 259, 248
plot 262, 248
plot 266, 248
plot 266, 244
plot 269, 244
plot 269, 234
plot 269, 237
plot 273, 237
plot 273, 240
plot 273, 244
plot 276, 244
plot 280, 247
plot 276, 220
plot 280, 223
plot 280, 223
plot 280, 226
plot 283, 226
plot 283, 230
plot 283, 233
plot 287, 233
plot 287, 237
plot 287, 240
plot 287, 244
plot 287, 247
plot 283, 209
plot 283, 209
plot 287, 209
plot 294, 209
plot 297, 209
plot 301, 209
plot 304, 209
plot 308, 209
plot 311, 209
plot 311, 212
plot 308, 216
plot 308, 216
plot 305, 216
plot 301, 219
plot 298, 223
plot 294, 226
plot 291, 226
plot 294, 226
plot 297, 226
plot 301, 226
plot 301, 223
plot 304, 223
plot 301, 226
plot 301, 230
plot 298, 230
plot 298, 233
plot 294, 233
plot 294, 237
plot 291, 240
plot 291, 240
waitkey

circle.bb
Graphics 640,480; Change to graphics mode, nothing tricky yet.
Origin 320,240 ; Move the point of orign for all drawing commands to the middle of the screen.

For degrees=0 To 359; Step though all the degrees in a circle (360 in all)
Delay(5); Wait 5 milli secsonds.

; The next line calculates the Y coordinate of the point of the circle using the Sin
; command, and multiplies it by 100 (to get a larger radius, try and change it).
y=Sin(degrees)*100

y=-y ; Invert Y coordinate to represent it properly on screen.

; The next line calculates the X coordinate of the point of the circle using the Cos,
; command, and multiplies it by 100 (to get a larger radius, try and change it).
x=Cos(degrees)*100

Plot x,y; Draw the current point on the circle.

Next ; Give us another angle

MouseWait ; Wait for the mouse.
End ; Terminate the program.

compiled draw.bb
Graphics 555,555,0,2
AppTitle "draw fast compiled "
f=WriteFile(Input$("name?")+".bb")
WriteLine f,"graphics 555,555,0,2"
While Not KeyHit(1)
If MouseDown(1) And( MouseXSpeed() <>0 Or MouseYSpeed()<>0) Then
Plot MouseX(), MouseY()
WriteLine(f,"plot "+MouseX()+", "+MouseY())
End If
Wend
WriteLine f,"waitkey"
CloseFile(f)

guess.bb
AppTitle "guess the no. 1 tO 10"
SeedRnd MilliSecs()
n=Rand(1,10)
Repeat
i=Int(Input$("guess the no. 1 tO 10?"))
If i=n Then
Print "Correct!"
WaitKey
Exit
Else
If i>n Then
Print "lower"
Else
Print "higher"
End If
End If
Forever

house.bb
Graphics 666,777,0,2
AppTitle "house"
Line 1,99,50,2
Line 50,2,198,99
Line 1,200,200,201
WaitKey

kaland.bb
Graphics 666,666,0,2
AppTitle "kaland"
Repeat
Cls
Print "egy erdoben vagy."
Print "van egy gomba a foldon."
Print "van egy piros virag itt."
Print ""
Select Trim$(Input$("Mit tenni?"))
Case "enni gomba","enni gombat","ed meg gombat","ed meg a gombat","edd meg a gombat","emeld gomba"
Print "felemelted es megeted a gombat."
Case "nez virag","nezd virag","nezd piros virag"
Print "piros"
Case "tepd"
Print "nem"
Default
Print "nem ertem."
End Select
WaitKey
Forever

ketto.bb
Graphics 666,666,0,2
AppTitle "ketto"
Text 333,333,"2",1,1
WaitKey

life.bb
Graphics 666,666,0,2
i=0
SetBuffer BackBuffer()
While Not KeyHit(1)
Cls
For m=1 To 12
Text Cos(359.0/Float(m))*(GraphicsWidth()/2)+(GraphicsWidth()/2),Sin(359.0/Float(m))*(GraphicsHeight()/2)+(GraphicsHeight()/2),Str$(m),1,1
Next
Line GraphicsWidth()/2,GraphicsHeight()/2,(Cos(i Mod 359)*(GraphicsWidth()/2))+(GraphicsWidth()/2),(-(Sin(i Mod 359)*(GraphicsHeight()/2)))+(GraphicsHeight()/2)
i=i+1
Flip
VWait
Wend

marslakó.bb
Graphics 666,666,0,2
Color 0,222,255
Oval 132,300,444,77,1
Color 77,77,77
Oval 0,333,666,134,1
WaitKey

matek.bb
SeedRnd MilliSecs()
AppTitle "matek kérdés"
a=Rand(1,100)
b=Rand(1,100)
c=Int(Input$("MI "+a+" + "+b+"?"))
If c=a+b Then
Print "igaz!"
Else
Print "nem igy van..."
End If
WaitKey

mouse speed.bb
Graphics 555,555,0,2
SetBuffer BackBuffer()
While Not KeyHit(1)
Cls
Color min(255,50*MouseXSpeed()),222,min(255,50*MouseYSpeed())
Oval MouseX(),MouseY(),Abs(MouseXSpeed()),Abs(MouseYSpeed()),1
Flip
VWait
Wend
Function min(a,b)
If aReturn a
Else
Return b
End If
End Function

mover.bb
Local x=0,y=0
AppTitle "Press the arrows to move"
While Not KeyHit(1)
SetBuffer BackBuffer()
Cls
Oval 3+x,3+y,55,55,0
Flip
If KeyHit(200) Then
y=y-55
Else If KeyHit(208) Then
y=y+55
Else If KeyHit(203) Then
x=x-55
Else If KeyHit(205) Then
x=x+55
End If
Wend

Free Web Hosting