100 Procedural Game Competition

Blitz3D Forums/Blitz3D Programming/100 Procedural Game Competition

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

A preview of a routine I did some work on in the last hour. Almost getting it right.. now just gotta draw the frame. :) Spent 5 hours programming tonight (not programming this, thank god!) so want to share something.. :) I've got over 30k of code already.. glad I'm using includes. :)

(oh yeah, and move the mouse around)

+BlackD


	Graphics3D 800,600
	HidePointer
	AppTitle "World Map Routine"
	Global tvtopmiddle=CreateImage(1,30)
	Global tvbotmiddle=CreateImage(60,30)
	Global tvtopleft=CreateImage(60,30)
	Global tvtopright=CreateImage(60,30)
	Global tvbotleft=CreateImage(60,30)
	Global tvbotright=CreateImage(60,30)
	Global tvmiddle=CreateImage(60,60)
	Global tvleftside=CreateImage(60,60)
	Global tvrightside=CreateImage(60,60)
		RenderTVImages()
		ClsColor 0,0,0
		While Not KeyHit(1)
			Cls
			DrawImage tvtopleft,40,100
			DrawImage tvbotleft,40,520
			x=100
			For n = 1 To 10
				DrawImage tvtopmiddle,x,100
				DrawImage tvbotmiddle,x,520
				x=x+60
				Next
			DrawImage tvtopright,760,100
			DrawImage tvbotright,760,520
			y=130:x=100
			For n = 1 To 6
				DrawImage tvleftside,40,y
				For i = 1 To 10
					DrawImage tvmiddle,x,y
					x=x+60
					Next
				DrawImage tvrightside,x+60,y
				y=y+60:x=100
				Next
			
			Color 0,100,0
			DrawMap(30,130)
			Color 0,70,0
			drawmap(30,130+Rand(-3,3))
			Color 0,80,0
			For n = 1 To 4
				x1=Rand(60,660)
				y1=Rand(130,530)
				Length=Rand(100)
				Line x1,y1,x1+length,y1
				Next
			If MouseX() > 50 And MouseX() < 750 And MouseY() > 110 And MouseY() < 510 Then
				Color 100,190,100
				Line MouseX(),105,MouseX(),515
				Line 45,MouseY(),755,MouseY()
				Oval MouseX()-5,MouseY()-5,11,11,0
				Color 100,255,100
				Oval MouseX()-2,MouseY()-2,5,5,0
				End If
			Flip
		Wend
		End
		Function RenderTVImages()
		SetBuffer BackBuffer()
		camera=CreateCamera()
		PositionEntity camera,0,10,0
		RotateEntity camera,90,0,0
		light=CreateLight(1)
		LightColor light,20,80,20
		RotateEntity light,55,90,0
		light2=CreateLight(1)
		LightColor light2,-255,-255,-255
		AmbientLight 0,0,0
		planetex=CreateTexture(128,128)
		SetBuffer TextureBuffer(planetex)
			Color 0,20,0
			Rect 0,0,128,128
			Color 0,80,0
			Rect 0,0,128,128,0
			Rect 1,1,127,126,0
			SetBuffer BackBuffer()
		ScaleTexture planetex,1.5,1.5
		plane=CreatePlane()
		EntityTexture plane,planetex
		cylinder=CreateCylinder()
		RotateEntity cylinder,-90,0,0
		EntityAlpha cylinder,.5
		ScaleEntity cylinder,2,1,1
		sphere=CreateSphere()
		EntityAlpha sphere,.5
		PositionEntity sphere,0,0,2.75
		ScaleEntity sphere,2,1,1
		UpdateWorld
		RenderWorld
		middletemp=CreateImage(1,60)
		GrabImage middletemp,379,270
		SetBuffer ImageBuffer(tvmiddle)
			For x = 0 To 59
				DrawImage middletemp,x,0
				Next
			Color 0,40,0
			Rect 15,0,2,60
			SetBuffer BackBuffer()
		FreeImage middletemp
		GrabImage tvleftside,320,270
		x=59
		tvrightside=CopyImage(tvleftside)
		TFormFilter 0
		TFormImage tvrightside,-1,0,0,1
		GrabImage tvtopleft,320,148
		SetBuffer ImageBuffer(tvtopleft)
			h#=23:Color 0,0,0
			For n=0 To 59
				Line n,0,n,h#
				h#=h#-.1-((59-n)*.01)	;cool curved 2D carve :) Ph33r teh mathz0r!
				Next
			SetBuffer BackBuffer()
		tvtopright=CreateImage(60,30)
		tvtopright=CopyImage(tvtopleft)
		TFormImage tvtopright,-1,0,0,1
		tvbotleft=CopyImage(tvtopleft)
		TFormImage tvbotleft,1,0,0,-1
		tvbotright=CopyImage(tvtopright)
		TFormImage tvbotright,1,0,0,-1
		GrabImage tvtopmiddle,379,148
		TFormImage tvtopmiddle,60,0,0,1
		SetBuffer ImageBuffer(tvtopmiddle)
			Color 0,40,0
			Rect 15,3,2,27
			SetBuffer BackBuffer()
		tvbotmiddle=CopyImage(tvtopmiddle)
		TFormImage tvbotmiddle,1,0,0,-1	
		FreeEntity plane
		FreeEntity camera
		FreeEntity light
		FreeEntity light2
		FreeEntity light3
		FreeEntity sphere
		FreeEntity cylinder
		FreeTexture planetex
		MaskImage tvtopright,255,255,255
		MaskImage tvbotright,255,255,255
		SetBuffer BackBuffer()
	End Function
	Function DrawMap(x=0,y=0)
		Line x+198,y+350,x+188,y+333
		Line x+188,y+333,x+195,y+310
		Line x+195,y+310,x+216,y+273
		Line x+216,y+273,x+231,y+267
		Line x+231,y+267,x+236,y+242
		Line x+236,y+242,x+244,y+225
		Line x+244,y+225,x+207,y+206
		Line x+207,y+206,x+202,y+196
		Line x+201,y+196,x+177,y+182
		Line x+177,y+182,x+150,y+180
		Line x+150,y+180,x+144,y+188
		Line x+144,y+188,x+145,y+198
		Line x+145,y+198,x+137,y+218
		Line x+137,y+218,x+150,y+242
		Line x+150,y+242,x+166,y+257
		Line x+166,y+257,x+167,y+308
		Line x+167,y+308,x+175,y+337
		Line x+175,y+337,x+186,y+351
		Line x+186,y+351,x+198,y+351
		Line x+146,y+183,x+136,y+183
		Line x+136,y+183,x+134,y+174
		Line x+134,y+174,x+124,y+166
		Line x+124,y+166,x+125,y+154
		Line x+125,y+154,x+111,y+157
		Line x+111,y+157,x+108,y+141
		Line x+108,y+141,x+140,y+130
		Line x+140,y+130,x+141,y+141
		Line x+141,y+141,x+148,y+141
		Line x+148,y+141,x+147,y+127
		Line x+147,y+127,x+160,y+117
		Line x+160,y+117,x+181,y+95
		Line x+181,y+95,x+195,y+94
		Line x+195,y+94,x+192,y+88
		Line x+192,y+88,x+192,y+81
		Line x+192,y+81,x+180,y+84
		Line x+180,y+84,x+193,y+78
		Line x+193,y+78,x+204,y+78
		Line x+204,y+78,x+214,y+74
		Line x+214,y+75,x+207,y+56
		Line x+207,y+56,x+187,y+49
		Line x+187,y+49,x+168,y+75
		Line x+168,y+75,x+151,y+60
		Line x+151,y+60,x+176,y+42
		Line x+176,y+42,x+189,y+35
		Line x+189,y+35,x+199,y+38
		Line x+199,y+38,x+188,y+43
		Line x+188,y+43,x+204,y+48
		Line x+204,y+48,x+216,y+41
		Line x+216,y+41,x+193,y+24
		Line x+193,y+24,x+175,y+32
		Line x+175,y+32,x+148,y+39
		Line x+148,y+39,x+111,y+35
		Line x+111,y+35,x+79,y+32
		Line x+79,y+32,x+54,y+33
		Line x+54,y+33,x+42,y+43
		Line x+42,y+43,x+27,y+53
		Line x+27,y+53,x+28,y+61
		Line x+28,y+61,x+59,y+58
		Line x+59,y+58,x+70,y+62
		Line x+70,y+62,x+76,y+87
		Line x+76,y+87,x+64,y+93
		Line x+64,y+93,x+64,y+117
		Line x+64,y+117,x+77,y+146
		Line x+77,y+146,x+74,y+127
		Line x+74,y+127,x+79,y+128
		Line x+79,y+128,x+89,y+156
		Line x+89,y+156,x+113,y+168
		Line x+113,y+168,x+128,y+182
		Line x+128,y+182,x+137,y+188
		Line x+137,y+188,x+145,y+187
		Line x+145,y+187,x+148,y+183
		Line x+132,y+32,x+139,y+26
		Line x+139,y+26,x+158,y+26
		Line x+158,y+26,x+151,y+34
		Line x+151,y+34,x+132,y+31
		Line x+189,y+20,x+200,y+21
		Line x+200,y+20,x+235,y+7
		Line x+235,y+7,x+200,y+9
		Line x+198,y+11,x+190,y+19
		Line x+202,y+8,x+197,y+12
		Line x+220,y+17,x+270,y+5
		Line x+270,y+5,x+307,y+12
		Line x+307,y+12,x+286,y+32
		Line x+286,y+32,x+255,y+44
		Line x+255,y+44,x+247,y+54
		Line x+247,y+54,x+232,y+48
		Line x+232,y+48,x+238,y+31
		Line x+238,y+31,x+232,y+21
		Line x+232,y+21,x+221,y+16
		Line x+206,y+84,x+213,y+77
		Line x+213,y+77,x+214,y+88
		Line x+214,y+88,x+205,y+82
		Line x+205,y+82,x+207,y+81
		Line x+136,y+149,x+145,y+148
		Line x+145,y+148,x+157,y+154
		Line x+157,y+154,x+151,y+156
		Line x+151,y+156,x+138,y+148
		Line x+158,y+161,x+160,y+156
		Line x+160,y+156,x+171,y+159
		Line x+171,y+159,x+158,y+160
		Line x+305,y+113,x+319,y+113
		Line x+319,y+113,x+331,y+99
		Line x+331,y+99,x+344,y+96
		Line x+344,y+96,x+354,y+105
		Line x+354,y+105,x+351,y+111
		Line x+351,y+111,x+356,y+112
		Line x+356,y+112,x+357,y+102
		Line x+357,y+102,x+349,y+91
		Line x+349,y+91,x+364,y+102
		Line x+364,y+102,x+369,y+115
		Line x+369,y+115,x+372,y+111
		Line x+372,y+111,x+371,y+105
		Line x+371,y+105,x+386,y+105
		Line x+386,y+105,x+386,y+109
		Line x+386,y+109,x+378,y+110
		Line x+378,y+110,x+380,y+114
		Line x+380,y+114,x+398,y+114
		Line x+398,y+114,x+407,y+103
		Line x+407,y+103,x+419,y+104
		Line x+419,y+104,x+427,y+94
		Line x+427,y+94,x+425,y+74
		Line x+425,y+74,x+437,y+58
		Line x+437,y+58,x+446,y+49
		Line x+446,y+49,x+441,y+42
		Line x+441,y+42,x+447,y+35
		Line x+447,y+35,x+440,y+27
		Line x+440,y+27,x+433,y+27
		Line x+433,y+27,x+433,y+34
		Line x+433,y+34,x+386,y+45
		Line x+386,y+45,x+388,y+37
		Line x+388,y+37,x+360,y+31
		Line x+360,y+31,x+345,y+44
		Line x+345,y+44,x+333,y+54
		Line x+333,y+54,x+348,y+64
		Line x+348,y+64,x+354,y+56
		Line x+354,y+56,x+363,y+44
		Line x+363,y+44,x+363,y+52
		Line x+363,y+52,x+374,y+54
		Line x+374,y+54,x+360,y+68
		Line x+360,y+68,x+332,y+72
		Line x+332,y+72,x+320,y+84
		Line x+320,y+84,x+323,y+92
		Line x+323,y+92,x+306,y+96
		Line x+306,y+96,x+304,y+113
		Line x+315,y+79,x+324,y+77
		Line x+324,y+77,x+322,y+70
		Line x+322,y+70,x+316,y+60
		Line x+316,y+60,x+310,y+63
		Line x+310,y+63,x+317,y+71
		Line x+317,y+71,x+313,y+78
		Line x+304,y+77,x+311,y+73
		Line x+311,y+73,x+312,y+68
		Line x+312,y+68,x+306,y+68
		Line x+306,y+68,x+304,y+76
		Line x+399,y+114,x+398,y+129
		Line x+398,y+129,x+399,y+136
		Line x+399,y+136,x+422,y+173
		Line x+422,y+173,x+451,y+158
		Line x+451,y+158,x+456,y+150
		Line x+456,y+150,x+445,y+142
		Line x+445,y+142,x+438,y+146
		Line x+438,y+146,x+430,y+133
		Line x+430,y+133,x+432,y+130
		Line x+432,y+130,x+455,y+142
		Line x+455,y+142,x+472,y+142
		Line x+472,y+142,x+480,y+152
		Line x+480,y+152,x+504,y+123
		Line x+504,y+123,x+482,y+110
		Line x+482,y+110,x+449,y+107
		Line x+449,y+107,x+426,y+93
		Line x+426,y+93,x+427,y+94
		Line x+398,y+128,x+367,y+123
		Line x+367,y+123,x+367,y+131
		Line x+367,y+131,x+345,y+121
		Line x+345,y+121,x+345,y+113
		Line x+345,y+113,x+321,y+115
		Line x+321,y+115,x+311,y+119
		Line x+311,y+119,x+297,y+136
		Line x+297,y+136,x+285,y+174
		Line x+285,y+174,x+298,y+193
		Line x+298,y+193,x+319,y+195
		Line x+319,y+195,x+336,y+193
		Line x+336,y+193,x+344,y+202
		Line x+344,y+202,x+354,y+236
		Line x+354,y+236,x+350,y+254
		Line x+350,y+254,x+364,y+300
		Line x+364,y+300,x+384,y+295
		Line x+384,y+295,x+399,y+267
		Line x+399,y+267,x+415,y+248
		Line x+415,y+248,x+411,y+219
		Line x+411,y+219,x+432,y+199
		Line x+432,y+199,x+439,y+178
		Line x+439,y+178,x+422,y+180
		Line x+422,y+180,x+411,y+168
		Line x+411,y+168,x+404,y+151
		Line x+403,y+151,x+397,y+133
		Line x+422,y+252,x+435,y+239
		Line x+435,y+239,x+436,y+250
		Line x+436,y+250,x+428,y+272
		Line x+428,y+272,x+422,y+274
		Line x+422,y+274,x+418,y+268
		Line x+418,y+268,x+423,y+259
		Line x+423,y+259,x+422,y+251
		Line x+442,y+29,x+488,y+20
		Line x+488,y+20,x+535,y+28
		Line x+535,y+28,x+585,y+33
		Line x+585,y+33,x+617,y+33
		Line x+617,y+33,x+641,y+50
		Line x+641,y+50,x+622,y+56
		Line x+622,y+56,x+628,y+74
		Line x+628,y+74,x+614,y+66
		Line x+614,y+66,x+614,y+54
		Line x+614,y+54,x+584,y+56
		Line x+584,y+56,x+582,y+68
		Line x+582,y+68,x+598,y+77
		Line x+599,y+77,x+599,y+97
		Line x+599,y+97,x+591,y+104
		Line x+591,y+104,x+598,y+114
		Line x+598,y+114,x+597,y+119
		Line x+597,y+119,x+583,y+108
		Line x+583,y+108,x+577,y+105
		Line x+577,y+105,x+572,y+110
		Line x+572,y+110,x+588,y+133
		Line x+588,y+133,x+586,y+147
		Line x+586,y+147,x+564,y+153
		Line x+564,y+154,x+559,y+158
		Line x+559,y+158,x+567,y+170
		Line x+567,y+170,x+568,y+180
		Line x+568,y+180,x+562,y+185
		Line x+562,y+185,x+550,y+173
		Line x+550,y+173,x+550,y+188
		Line x+550,y+188,x+558,y+196
		Line x+558,y+196,x+558,y+204
		Line x+558,y+204,x+552,y+198
		Line x+552,y+198,x+544,y+185
		Line x+544,y+185,x+543,y+166
		Line x+543,y+166,x+536,y+166
		Line x+536,y+166,x+527,y+151
		Line x+526,y+151,x+518,y+153
		Line x+518,y+153,x+509,y+160
		Line x+509,y+160,x+504,y+169
		Line x+504,y+169,x+504,y+180
		Line x+504,y+180,x+498,y+184
		Line x+498,y+184,x+485,y+155
		Line x+485,y+155,x+480,y+152
		Line x+480,y+152,x+481,y+151
		Line x+540,y+194,x+547,y+198
		Line x+547,y+198,x+566,y+218
		Line x+566,y+218,x+565,y+221
		Line x+565,y+221,x+580,y+227
		Line x+580,y+227,x+582,y+230
		Line x+582,y+230,x+566,y+226
		Line x+566,y+226,x+564,y+222
		Line x+564,y+222,x+558,y+221
		Line x+558,y+221,x+548,y+208
		Line x+548,y+208,x+541,y+196
		Line x+541,y+196,x+541,y+195
		Line x+571,y+205,x+574,y+205
		Line x+575,y+204,x+590,y+192
		Line x+590,y+192,x+594,y+197
		Line x+594,y+197,x+589,y+205
		Line x+589,y+205,x+589,y+215
		Line x+589,y+215,x+579,y+216
		Line x+579,y+216,x+571,y+205
		Line x+623,y+210,x+630,y+210
		Line x+630,y+210,x+630,y+215
		Line x+630,y+215,x+638,y+212
		Line x+638,y+212,x+654,y+222
		Line x+654,y+222,x+665,y+234
		Line x+665,y+234,x+656,y+232
		Line x+656,y+232,x+652,y+227
		Line x+652,y+227,x+647,y+230
		Line x+647,y+230,x+636,y+229
		Line x+636,y+229,x+637,y+223
		Line x+637,y+223,x+625,y+217
		Line x+625,y+217,x+623,y+211
		Line x+596,y+68,x+606,y+80
		Line x+606,y+80,x+609,y+86
		Line x+609,y+86,x+613,y+84
		Line x+613,y+84,x+608,y+78
		Line x+608,y+78,x+596,y+67
		Line x+612,y+90,x+612,y+102
		Line x+612,y+102,x+622,y+97
		Line x+622,y+97,x+613,y+90
		Line x+616,y+104,x+621,y+111
		Line x+621,y+111,x+625,y+120
		Line x+625,y+120,x+613,y+123
		Line x+613,y+123,x+607,y+130
		Line x+607,y+130,x+604,y+123
		Line x+604,y+123,x+614,y+116
		Line x+614,y+116,x+618,y+112
		Line x+618,y+112,x+616,y+104
		Line x+504,y+189,x+507,y+186
		Line x+507,y+186,x+510,y+191
		Line x+510,y+191,x+505,y+194
		Line x+505,y+194,x+505,y+188
		Line x+587,y+230,x+603,y+230
		Line x+603,y+230,x+588,y+232
		Line x+588,y+232,x+588,y+230
		Line x+602,y+234,x+612,y+227
		Line x+612,y+227,x+612,y+231
		Line x+612,y+231,x+603,y+232
		Line x+594,y+211,x+603,y+205
		Line x+604,y+205,x+602,y+217
		Line x+602,y+217,x+606,y+223
		Line x+606,y+223,x+595,y+216
		Line x+595,y+216,x+592,y+221
		Line x+592,y+221,x+594,y+210
		Line x+600,y+189,x+610,y+184
		Line x+610,y+184,x+612,y+190
		Line x+612,y+190,x+607,y+195
		Line x+607,y+195,x+602,y+189
		Line x+594,y+160,x+594,y+172
		Line x+594,y+172,x+601,y+177
		Line x+601,y+177,x+601,y+171
		Line x+601,y+171,x+594,y+161
		Line x+592,y+143,x+592,y+143
		Line x+587,y+148,x+592,y+143
		Line x+587,y+148,x+593,y+152
		Line x+593,y+152,x+593,y+144
		Line x+574,y+268,x+595,y+258
		Line x+595,y+258,x+601,y+249
		Line x+601,y+249,x+610,y+245
		Line x+611,y+245,x+613,y+249
		Line x+613,y+249,x+620,y+241
		Line x+620,y+240,x+631,y+240
		Line x+631,y+240,x+630,y+253
		Line x+630,y+253,x+642,y+252
		Line x+642,y+252,x+645,y+237
		Line x+645,y+237,x+655,y+259
		Line x+655,y+259,x+662,y+279
		Line x+662,y+279,x+651,y+294
		Line x+651,y+294,x+640,y+308
		Line x+639,y+308,x+623,y+308
		Line x+623,y+308,x+610,y+291
		Line x+610,y+291,x+592,y+291
		Line x+592,y+291,x+577,y+297
		Line x+577,y+297,x+571,y+297
		Line x+571,y+297,x+574,y+280
		Line x+574,y+280,x+574,y+268
		Line x+624,y+316,x+629,y+313
		Line x+629,y+313,x+634,y+314
		Line x+634,y+314,x+627,y+320
		Line x+627,y+320,x+624,y+315
		Line x+680,y+313,x+687,y+303
		Line x+687,y+303,x+683,y+301
		Line x+683,y+301,x+679,y+312
		Line x+688,y+300,x+694,y+292
		Line x+694,y+292,x+684,y+286
		Line x+684,y+286,x+688,y+292
		Line x+688,y+292,x+685,y+297
		Line x+685,y+297,x+689,y+298
	End Function