Procedural Programming Competition Final Rules

Blitz3D Forums/Blitz3D Programming/Procedural Programming Competition Final Rules

Procedural Programming Competition

Show your programming skill by writing a game that has no external content!!!

- 2D or 3D welcome.
- No resources packed into the EXE either in any form (as DATA, or in any appended method)
- All resources (sounds, images, meshes, etc) must be generated by code. (eg. AddTriangle, CreateImage, etc) Although level defination data (like array data is valid)
- All code must be your own, this is a competition of your programming abilities, not those of someone who posted to code archives or whatever.
- No calls to external libraries. Included .bb files of your own are welcome, but no DLLs, .decls, etc.
- Files may only be written out in instances where it is impossible to utilize a function of Blitz without writing a file. All the file in the data must be generate by code. Examples of uses for this:
... Sounds.
... Save game files.
... OpenMovie (if you use animated GIFs.. I don't see anyone generating an AVI in runtime :))
... LoadMD2 (remember though, the contents of the model must be generate by code, not DATA statements, so again I don't see people using this, but its here to illustrate the point.)
- No references to any files NOT created by your program. Ie, you can't decide to use DING.WAV as a sound effect simply because it's there.

Submition!

Entries will be accepted between Monday October 23rd and November 8th. Submit entries to this forum thread by a link or by including the code text in you post.

You can use include files while creating your entry, but the file submitted entry must be 1 bb file. So all the includes will have to be copied to this bb file before submitting.

Awards
1st Place
2nd Place
3rd Place

Awards...well, you'll have a great game to show your buddies...ok, basically there is no prize, but what the heck, it will be a lot of fun!!!

The week after the 8th, we'll let people, other then the people that entered, vote on their favorites.

Yay! Time to start coding. :) BTW, are multiple entries allowed?

sure, why not.

For clarification: accessing fonts aside from the default is also disallowed? Otherwise symbols and such could be stupidly easy to drag up via a LoadFont call.

"No references to any files NOT created by your program. Ie, you can't decide to use DING.WAV as a sound effect simply because it's there."
Yes, no fonts. A font is an external file. :)

Technically you're calling an outside file by default even without LoadFont when you use the Text commands (MS Sans Serif.ttf if I remember right). Just wanted to be sure it was safe to assume we could use the default font but nothing else.

I dont think the default font should be allowed:
you could of course create an internally stored font engine of your own...

In the instance of meshes etc created by code, yet Loaded by the actual comp entry, should the generating code be submitted also?

@aab.... course the default font should be alowed- all systems have a form of "print" command >.<

@malice...
the entry cannot have any files along with the main .bb file, so your entry must generate the mesh itself.


- Files may only be written out in instances where it is impossible to utilize a function of Blitz without writing a file. All the file in the data must be generate by code. Examples of uses for this:
... Sounds.
... Save game files.
... OpenMovie (if you use animated GIFs.. I don't see anyone generating an AVI in runtime :))
... LoadMD2 (remember though, the contents of the model must be generate by code, not DATA statements, so again I don't see people using this, but its here to illustrate the point.)


?

He means the MD2 must be generated by the program itself at runtime prior to running the game.

The file format can be found here if you feel up to it:

http://linux.ucla.edu/~phaethon/q3a/formats/md2-schoenblum.html

My games comming along quite nicely, how about yours? :P

Very well thankee. :P

No using the default font?! Is it not better spending more time on the game itself? This seems a bit extreme to me - fair enough sounds and meshes etc.. but .. you're kidding right?

Anywho I started making Stunt Car racer but wouldn't have had the time to do the physics .. a WIP screenie.



Oooooo lookin nice Stevie G. You're dangerous at this stuff so I fully expect that'll be aces to play!

Well, I don't think Craig meant we're not allowed to use the default font. :) If we weren't allowed to, them by the same logic we couldn't use any graphics, as Blitz calls DirectX dlls. ;) In fact, no text, no graphics, we can just make diferent sized black-screens. ;) But seriously, I'm using default font and some conversion routines to make it into something nicer. :)

Anyway, a couple of pretty boring WIP shots..



Lots of pretty pre-rendering (yes, my game has "loading" screens hehe) going on. :)

+BlackD

druck! (i say "druck" because my last post with a swear in it got removed)..yousa kicked my ass already!

lol.. yeah - but those of us going all-out with our games may not finish in time. Besides its about having fun, so don't worry. :)

Alright alright, I'll allow the default font, BUT THAT'S IT!!!!!

wow stevieg - that's pretty darn impressive since the comp started yesterday. :) wish i could do that in one day.

im only in it to have fun, no point otherwise :D

Course, i could include quad v1.0, which was all generated meshes.

@StevieG: that looks MAD! how did you generate the meshes!?

It took 32,000 lines of data to create that track - do you think I'll get done for cheating!?

Only kidding!!! Believe it or not it takes very little code and data to do this - that whole track is initially 24 * (x,y,z data coords ) - all the other points are calculated using bezier interpolation between these points. The kerbs, grass verge etc.. are just extrusions perpendicular to the middle of the road etc...

hax ;)

Hax?

Stevie. Level defination data is valid for the contest. I procedurely created level would probably be pretty boring.

@steve:
Thats pretty neat- any chance of seeing how youve done it? obviously if you dont want to let it out, thats okay, but that code...well, itl help me out quite a bit in a few areas!!!

I can see youve used a plane, so that simplifies things out- i myself have made a track creation routine in a certain mode of quad2 but ive had to select certain "random seeds" so the tracks dont cross over- which would just rock if i could do it...

Heres what i did... unfortunately in this screenie ive moved far away from anything alowed in this contest but it did all START "procedural" :/


I can't see your picture mate.

It's not optimised in any shape or form and a bit sloppy but for what it's worth ...

Graphics3D 640,480,16,1

Global camera
Global plane
Global light 
Global track
Global p1.CarType
Global p2.CarType
Global Points=0
Global PP=0
Global Pivot=CreatePivot()

Type PointType
	Field x#, y#,z#
End Type

Type CarType
	Field Model
	Field Target
	Field Vx#, Vy#, Vz#
	Field Acceleration#
	Field Brakes#
	Field Traction#
	Field Speed#
	Field TopSpeed#
	Field Wheel[3]
End Type

Dim Point.PointType( 2000 )
Dim TP.PointType( 6, 20000 )

GAMEinit()
TRACKinit()
RACEinit()
	
While Not KeyDown(1)

	GAMEupdate()

Wend

End

;=================================================
;=================================================
;=================================================

Function RACEinit()
	
	PositionEntity P1\Model,TP(3,0 )\x,TP(3,0)\y,TP(3,0)\z
	PositionEntity Pivot,TP(3,1)\x, TP(3,1)\y, TP(3,1)\z
	PointEntity P1\Model, Pivot

	PositionEntity P2\Model,TP(3,0 )\x,TP(3,0)\y,TP(3,0)\z
	PositionEntity Pivot,TP(3,1)\x, TP(3,1)\y, TP(3,1)\z
	PointEntity P2\Model, Pivot
	
End Function

;=================================================
;=================================================
;=================================================

Function CARupdate( c.Cartype )

	jx# = -JoyX():If Abs(jx) < .25 jx = 0
	jb =JoyDown(3)

	TurnEntity c\Model, 0, jx * 3.0,0
	For w = 0 To 1
		RotateEntity c\wheel[w],EntityPitch(c\wheel[w]),jx*45.0,0
	Next
		
	c\Speed = LIMIT ( c\Speed + ( jb * c\Acceleration ) - ( ( Not jb ) * c\Brakes ) , 0, c\TopSpeed )
	TFormVector 0,0,(1.0 - c\Traction ), c\Model, 0
	c\Vx = ( c\Vx * c\Traction ) + ( TFormedX() * c\Speed )
	c\Vz = ( c\Vz * c\Traction ) + ( TFormedZ() * c\Speed )
	c\Vy = ( c\Vy * c\Traction ) + ( TFormedY() * c\Speed ) - gravity

	TranslateEntity c\Model, c\Vx, c\vy , c\Vz
	
	For l = 0 To 3
		TurnEntity c\wheel[l],c\Speed * 90.0 / (Pi),0,0
	Next
	
	;collisions
	unused = LinePick ( EntityX(c\Model,1),EntityY(c\model,1)+5,EntityZ(c\model,1),0,-20,.2 )
	picked = PickedEntity()
	If picked = Track Or picked = plane
		;hug track
		TranslateEntity c\Model,0,PickedY()-EntityY(c\Model)+.1,0
		nx#=PickedNX():ny#=PickedNY():nz#=PickedNZ()
		AlignToVector c\Model,nx,ny,nz,2,.25
	EndIf 
	
End Function

;=================================================
;=================================================
;=================================================

Function GAMEupdate()

	CARupdate( p1 )
	CAMERAupdate()
	RenderWorld()
	Flip

End Function

;=================================================
;=================================================
;=================================================

Function CAMERAupdate()
	tx# = ( EntityX( P1\Target,1 ) - EntityX( Camera ) ) * .25
	ty# = ( EntityY( P1\Target,1) - EntityY( Camera) ) *.25
	tz# = ( EntityZ( P1\Target,1 ) - EntityZ( Camera ) ) *.25
	TranslateEntity Camera, tx, ty, tz
	PointEntity Camera, p1\Model,EntityRoll( p1\Model)
End Function

;=================================================
;=================================================
;=================================================

Function WRAP#( q#, b#)

	If q>=b Then q=q-b
	If q<0 Then q=b+q
	Return q	

End Function

;=================================================
;=================================================
;=================================================

Function LIMIT#(n#,n1#,n2#)
	
	If n>n2 Then n=n2
	If n<n1 Then n=n1	
	Return n

End Function

;=================================================
;=================================================
;=================================================

Function JOIN (x1,y1,z1,vx,vy,vz,x2,y2,z2)

	For t#=.1 To 1 Step .1 
		TP( 3, pp ) = New PointType
		TP(3,pp)\x = x1*(1-t)^3 + 3*vx*(1-t)^2*t + 3*vx*(1-t)*t^2 + x2*t^3
		TP(3,pp)\y = limit( y1*(1-t)^3 + 3*vy*(1-t)^2*t + 3*vy*(1-t)*t^2 + y2*t^3 , 0, 10.0 )
		TP(3,pp)\z = z1*(1-t)^3 + 3*vz*(1-t)^2*t + 3*vz*(1-t)*t^2 + z2*t^3
		pp=pp+1
	Next

End Function

;=================================================
;=================================================
;=================================================

Function GAMEinit()

	plane = CreatePlane()
	EntityColor plane,150,100,75
	EntityPickMode plane, 2
	EntityOrder plane,1
	EntityFX plane,1+16
	
	camera = CreateCamera()
	CameraClsColor camera,50,100,200
	PositionEntity camera,0,500,0
		
	light = CreateLight()
	RotateEntity light,30,-60,0 
		
	P1 = MESHcar( 200,200,50 )
	P2 = MESHcar( 50,200,200 )

End Function

;=================================================
;=================================================
;=================================================

Function TRACKinit()

	;points
	Restore LEVELdata
	Read points
	For l = 0 To points-1
		point( l*2 ) = New pointtype
		Read point(l*2)\x
		Read point(l*2)\y 
		Read point(l*2)\z
	Next
		
	;mid points
	For l= 0 To points-1 
		m = l*2+1
		v = ( l+1 ) Mod points
		point( m) = New pointtype
		point( m)\x = ( point(l*2)\x + point(v*2)\x ) * .5
		point( m)\y = ( point(l*2)\y + point(v*2)\y ) * .5
		point( m)\z = ( point(l*2)\z + point(v*2)\z ) * .5
	Next
	points = points * 2 
		
	;smooth bezier curves
	For l= 0 To points-1 Step 2
		k = ( l+1) Mod points
		n = ( l + 2 ) Mod points
		m = ( l + 3 ) Mod points
		JOIN ( point( k )\x , point( k )\y, point( k )\z, point( n )\x, point ( n )\y, point(n)\z, point( m)\x, point(m)\y , point(m)\z )
	Next
	
	;tangents
	Color 255,255,255
	For l = 0 To pp-1
		m = ( l-1+pp ) Mod pp
		n = ( l + 1 ) Mod pp
		dx# = TP(3, l )\x - TP(3,m)\x
		dz# = TP(3, l )\z - TP(3,m)\z
		d#  = Sqr ( dx*dx + dz*dz) * 2.0
		ax# = dx/d
		az# = dz/d
		dx# = TP(3, n )\x - TP(3,l)\x
		dz# = TP(3, n )\z - TP(3,l)\z
		d#  = Sqr ( dx*dx + dz*dz) * 2.0
		ax# = ax# + dx/d
		az# = az# + dz/d
				
		For q = 0 To 6
			
			dr# = Sgn(q-3)
			
			Select Abs(q-3)
				Case 1 
					Width# = 5.0
					Height# = TP(3,l)\y
				Case 2 
					Width# = 6.0
					Height# = TP(3,l)\y+.5
				Case 3 
					width# = 10.0
					Height# = 0
					If TP(3,l)\y = 10.0 
						Height = TP(3,l)\y-2.5
						Width = 7.0
					EndIf 
			End Select
	
			If q<>3
				TP(q,l) = New pointtype
				TP(q,l)\x = TP(3,l)\x - az * width *dr
				TP(q,l)\y = Height 
				TP(q,l)\z = TP(3,l)\z + ax * width * dr
			EndIf
			
		Next
		
	Next	
			
	;show tangents
	For l = 0 To pp-1
		n = ( l + 1 ) Mod pp
		For q = 0 To 6	
			Select q
				Case 3 Color 200,50,50
				Default Color 50,50,50
			End Select	
			Line TP(q,l)\x+320, 240-TP(q,l)\z, TP(q,n)\x+320, 240 - TP(q,n)\z
		Next
		Color 50,50,200
		Line TP(2,l)\x+320, 240-TP(4,l)\z, TP(2,l)\x+320, 240-TP(4,l)\z
		Color 255,255,255
		Text TP(3,l)\x + 320, 240-TP(3,l)\z,Str$(l),1,1
	Next
	Flip
	MouseWait
	
	;make 3d mesh
	Track = MESHtrack()
	
End Function

;=================================================
;=================================================
;=================================================

Function MESHtrack()

	mesh = CreateMesh()
	s = CreateSurface( mesh )
	For l = 0 To pp-1
		n = ( l + 1 ) Mod pp
		d = ( l Mod 2 )

		;road
		v0 = AddVertex( s, TP(2,n)\x, TP(2,n)\y, TP(2,n)\z )
		v1 = AddVertex( s, TP(4,n)\x, TP(4,n)\y, TP(4,n)\z )
		v2 = AddVertex( s, TP(4,l)\x, TP(4,l)\y, TP(4,l)\z )
		v3 = AddVertex( s, TP(2,l)\x, TP(2,l)\y, TP(2,l)\z )
		For v = v0 To v3
			Select d
				Case 0 r=100:g=100:b=150
				Case 1 r=150:g=150:b=200
			End Select
			VertexColor s,v,r,g,b
		Next
		AddTriangle s,v2,v1,v0
		AddTriangle s,v0,v3,v2
		
		;kerb
		v4 = AddVertex( s, TP(0,n)\x, TP(0,n)\y, TP(0,n)\z )
		v5 = AddVertex( s, TP(1,n)\x, TP(1,n)\y, TP(1,n)\z )
		v6 = AddVertex( s, TP(1,l)\x, TP(1,l)\y, TP(1,l)\z )
		v7 = AddVertex( s, TP(0,l)\x, TP(0,l)\y, TP(0,l)\z )
		v8 = AddVertex( s, TP(5,n)\x, TP(5,n)\y, TP(5,n)\z )
		v9 = AddVertex( s, TP(6,n)\x, TP(6,n)\y, TP(6,n)\z )
		v10 = AddVertex( s, TP(6,l)\x, TP(6,l)\y, TP(6,l)\z )
		v11 = AddVertex( s, TP(5,l)\x, TP(5,l)\y, TP(5,l)\z )
		For v = v4 To v11
			Select d
				Case 0 r=50:g=150:b=50
				Case 1 r=75:g=200:b=75
			End Select
			VertexColor s,v,r,g,b
		Next
		AddTriangle s,v6,v5,v4
		AddTriangle s,v4,v7,v6
		AddTriangle s,v10,v9,v8
		AddTriangle s,v8,v11,v10
		
		;grass
		v12 = AddVertex( s, TP(1,n)\x, TP(1,n)\y, TP(1,n)\z )
		v13 = AddVertex( s, TP(2,n)\x, TP(2,n)\y, TP(2,n)\z )
		v14 = AddVertex( s, TP(2,l)\x, TP(2,l)\y, TP(2,l)\z )
		v15 = AddVertex( s, TP(1,l)\x, TP(1,l)\y, TP(1,l)\z )
		v16 = AddVertex( s, TP(4,n)\x, TP(4,n)\y, TP(4,n)\z )
		v17 = AddVertex( s, TP(5,n)\x, TP(5,n)\y, TP(5,n)\z )
		v18 = AddVertex( s, TP(5,l)\x, TP(5,l)\y, TP(5,l)\z )
		v19 = AddVertex( s, TP(4,l)\x, TP(4,l)\y, TP(4,l)\z )
		For v = v12 To v19
			Select d
				Case 0 r=200:g=50:b=50
				Case 1 r=200:g=200:b=200
			End Select
			VertexColor s,v,r,g,b
		Next
		AddTriangle s,v14,v13,v12
		AddTriangle s,v12,v15,v14
		AddTriangle s,v18,v17,v16
		AddTriangle s,v16,v19,v18
		
		;underside	
		If TP(3, n )\y =10 Or TP(3, l )\y=10
			v20 = AddVertex( s, TP(0,n)\x, TP(0,n)\y, TP(0,n)\z )
			v21 = AddVertex( s, TP(6,n)\x, TP(6,n)\y, TP(6,n)\z )
			v22 = AddVertex( s, TP(6,l)\x, TP(6,l)\y, TP(6,l)\z )
			v23 = AddVertex( s, TP(0,l)\x, TP(0,l)\y, TP(0,l)\z )
			For v = v20 To v23
				Select d
					Case 0 r=50:g=50:b=200
					Case 1 r=50:g=50:b=150
				End Select
				VertexColor s,v,r,g,b
			Next
			AddTriangle s, v20,v21,v22
			AddTriangle s,v22,v23,v20 
		EndIf
			
	Next
	
	EntityFX mesh,2
	EntityPickMode mesh,2
	UpdateNormals mesh
	Return mesh

End Function

;=================================================
;=================================================
;=================================================

Function MESHcar.CarType( r,g,b)

	c.CarType = New CarType
	c\Model = CreateCube()
	PositionMesh c\Model,0,1,0
	ScaleMesh c\Model,.5,.5,1
	UpdateNormals c\Model
	EntityColor c\Model,r,g,b
			
	c\Target = CreatePivot( c\Model )
	PositionEntity c\Target,0,4,-8
	
	temp = CreateCylinder( 5 )
	RotateMesh temp,0,0,90
	ScaleMesh temp,.25,.5,.5
	EntityColor temp,50,50,50
	w=0
	For z# = .75 To -1 Step -1.75
		For x# = -1 To 1 Step 2
			c\Wheel[w] = CopyEntity( temp, c\Model )
			UpdateNormals c\Wheel[w]
			PositionEntity c\Wheel[w],x,.5,z
			w = w + 1
		Next
	Next
	FreeEntity temp
	
	shadow = CreateCube( c\Model )
	ScaleEntity shadow,1.25,.01,1.25
	EntityColor shadow,50,50,50
	EntityAlpha shadow,.5
	
	c\Acceleration = .01
	c\Brakes = .005
	c\Traction = .95
	c\Speed = 0.0
	c\TopSpeed = 1.25
	c\Vx = 0
	c\Vy = 0
	c\Vz = 0
			
	Return c

End Function

;=================================================
;=================================================
;=================================================

.LEVELdata

Data 25
Data 32,0,80
Data -32,0,80
Data -64,1,48
Data -96,3,-16
Data -128,0,-16
Data -160,3,48
Data -160,0,112
Data -160,5,176
Data -96,0,176
Data -32,0,208
Data 32,0,208
Data 96,5,176
Data 96,5,144
Data 32,0,144
Data -32,0,144
Data -128,11,144
Data -192,11,144
Data -224,0,112
Data -224,0,16
Data -256,8,-16
Data -256,8,-48
Data -192,3,-112
Data -128,0,-112
Data -64,5,-144
Data 32,7,-112
Data 96,0,16


cheers dude

Odd about that pic- if you paste the link into FireFox it works.. but there, it doesnt. godknows.

Il check it out tomorow. While my server is down i have no real power over the files! :(

[edit]

Mate, that is AMAZING.

would you mind me taking that code to learn from? its not too dissimilar to my routine but yours seems more efficient than mine and caps holes in meshes (the side bits and tunnels)

IMO, you should turn this into an entry still. You dont need physics to make it fun!!! shove some AI in there, a menu screen, n (maybe) a quick powerboost collectable... and you have a blitz hit!

Nice work dude!


..Meanwhile, my entry is going slow as im now working again :(

I've always wondered this. How do you guy post your code so it's green like that? I've also seen were you have it in a little window with scroll bar on the side.

<code></code>

and

<codebox></codebox>

And, of course, you replace the angular brackets with square brackets ([]).

The name of my incredibly week entry is SQUARE APPLES! In the game you are in control of a laser ball cannon and you have to launch laser balls at the decending SQUARE APPLES! its pretty easy and the game lasts like 60 seconds but its the first time ive ever made a game only using blitz functions to create all the artwork. Enjoy.

SQUARE APPLES!.zip
http://www.omzignilmerg.com/SQUARE%20APPLES!.zip

i wouldnt say thats weak, thats quite fun for a small amount of time :D

Here is a screenshot of my entry that I don't think will be done in time. But what do ya think? It's a cross between space invaders,astroids,and dare I say it... Diablo.



Nice lookin work matie! may i suggest creating a new text routine though, create a set of images for each char and use the normal text and colour commands to draw to the images... can look quite a bit nicer than the blitz normal font...

i got a quick question.

Weve said DATA is allowed for levels providing they dont come from a level editor... this is okay for sounds too right?

i mean, ive written a sound system that runs using channels and such, like this:
sound channel,volume,pitch,length"


and ived stored my music like this:
Data 1,1,40,4
Data 2,1,52,4
Data 1,0,40,1
Data 2,0,52,1
Data 1,1,40,4
Data 2,1,52,4
Data 1,0,40,1
Data 2,0,52,1



is this okay? id imagine so as its not realy a stored resource.. but i dont want to get disqualified or anything :D

yeah I'm pretty sure thats allowed. The rule against storing sounds as data is referring to storing sound data as data. Ie, you can't convert the DataChunk section of a WAV file to DATA statements, then simply write it back out along with a HeaderChunk and FormatChunk to create a perfectly original copy of the WAV file. :)

Creating the wave data by a mathematical statement ISN'T storing sound data. :) I did it the same way you did, writing out a sin wave. My code:

exists=OpenFile("test.wav")
	If exists Then CloseFile exists:DeleteFile("test.wav")
	
	wave=WriteFile("test.wav")
	
	;Choose our settings
	Length = 1
	SampleRate = 44100
	NumChannels = 1
	BitsPerSample = 16
	frequency=120
	volume=25
	
	;Do Some calcs
	NumSamples = SampleRate * Length
	SubChunkSize = (NumSamples * NumChannels * BitsPerSample / 8) + 36
		
	
	;Write RIFF Chunk Descriptor
	WriteByte wave,82
	WriteByte wave,73
	WriteByte wave,70
	WriteByte wave,70
	WriteInt wave,SubChunkSize
	WriteByte wave,87
	WriteByte wave,65
	WriteByte wave,86
	WriteByte wave,69
	
	;Write FMT subchunk
	WriteByte wave,102
	WriteByte wave,109
	WriteByte wave,116
	WriteByte wave,32
	WriteInt wave,16
	WriteByte wave,1
	WriteByte wave,0
	WriteByte wave,NumChannels
	WriteByte wave,0
	WriteInt wave,Samplerate
	WriteInt wave,Samplerate * Numchannels * BitsPerSample / 8
	WriteByte wave,NumChannels * BitsPerSample / 2
	WriteByte wave,0
	WriteByte wave,BitsPerSample
	WriteByte wave,0
	
	;Write DATA subchunk
	WriteByte wave,100
	WriteByte wave,97
	WriteByte wave,116
	WriteByte wave,97
	WriteInt wave,NumSamples * NumChannels * BitsPerSample / 8

	For i = 0 To NumSamples*2
		sample#=volume*Sin(Pi*frequency*i/(NumSamples/frequency))
		WriteByte wave,sample#
		Next
		
	CloseFile wave
	
	Print "Test.Wav created"
	Print "Press ESC to quit or any key to play."
	wave=LoadSound("test.wav")
	While Not KeyHit(1)
		If KeyHit(28) Then 
		t=MilliSecs()
		channel=PlaySound(wave)
		End If
		If MilliSecs() > (t+900) And ChannelPlaying(channel) Then StopChannel(channel)
	Wend
	End

The sound has a click at the end that I never got around to ironing out. However sadly though, I am now withdrawing from this competition. I've been trying to work on my other main project (which I'm also under some time constraint to produce, though much longer :)) at the same time and although my entry is coming along nicely, I won't have time to finish it. :(

@StevieG: asking nicely.. :) Could you please change your CODE tags to CODEBOX cause thats making a huge amount of scrollage in this thread. :)

+BlackD

Sorry to hear you withdrawing, BlackD, i may have to myself also.. but im trying.

With WAV, you need to end and start the .wav at 32762.5 otherwise you get the click.. not sure if youve done that!

whatever happens though, i will release the sound engine i wrote for this compo. My games got 1456 lines in it now!

hehe.. that means, so far, Square Apples is winning! :D

lol! its a nice lil game IMO. of course, il still work on my entry even if i miss the deadline, and il still let it out to y'all!!!

Codebox added - sorry :)

@Blackd - Blitz can't read the sound you created and the .wav doesn't play in windows media player? Not sure what's wrong there.

I too don't really have time to finish my entry on time - in the middle of making an Oids / Lundar lander level editor atm.

One of the rules is: - All code must be your own, this is a competition of your programming abilities, not those of someone who posted to code archives or whatever.

Why do I see people posting their code, showing how they did something? Thats just asking people to use it in their entry.

Chill MrSAK it's only a piss about ... the winner gets HE HAW so what difference does it make?

He was having a bad time.. hehe..
this is for fun.. enjoy it!

Yeah, this is all in good fun. I don't know about you guys, but I'm having a total blast coding my game. Hope I can get it done in time too.

Love that wave code by the way, I don't know how to code sound, so I either cheat or have no sound.

Surprizingly, My friends at work here really like the game I came up with so far. I thought it was just kind of a hack. It's a mix between the original wolfenstein, a pinball machine, and tron. One guy actually played all the way through all the levels I made! Who knows, might be worth explanding into a full blow shareware title.

Wish I could show a pic, but I don't have webspace to do that. Anyone know an easy way to get your pics on the web?

i would normally do that for you- but since BlueYonder seem to think i broke.. yeah, ive said it so many times :(

Yup, tis fun! Mine is bomberman+pacman+boulderdash... ^.^

>>Wish I could show a pic, but I don't have webspace to do that. Anyone know an easy way to get your pics on the web?<<

I just use my home page made with one two three click. Thats a thing you get with Aol.

@Craig Nisbet - yeah, just create a Geocities account and host the images there. Sure you only got like 100 meg transfer limit per day, but you're never going to use that up with a image shown in a thread. :) Mine are still up ^^

its okay that i post a demo of my entry isnt it?


Demo

Screenie

Hey, i had this as an edit before, but to bump this subject aswell:

if i post a link like this:
Http://danjeruz.servegame.com/Pics/compgame .JPG
then it wont show in a thread:

however, copying the link to a browser window works...!

i have to do this instead. Whats up with that?

Wow! That sound system is amazing!

I designed the sound system as an include, and it would work for a blugin in most programs.. just need to change some variable names and itl be ready. ive put about half the effort of this project into the sound system! hehe.

Il release source for everything at the end, as rules say. and im sure Blitzers will find many uses for the sound system, mainly in the 8-bit-compos!!!

Cheers again!

[edit]

I never realised i had given out the source. hehe. oh well, youl get it anyway so why not now :P

Yeah, this a great open source contest. They should make a special section in the code archives for it, seeing there's no external content.

I'm think about seeing if I can find some sponsers for another compition like this one. This has been a lot of fun! Maybe next time we can have some actual prizes!

Here's a code donation from my project. Had to make some extended primitives.

Function CreateWedge(ParentEntity=0)
	wedge=CreateMesh()
	surf=CreateSurface(wedge)
	;Sides
	v1=AddVertex(surf,-1,-1,1,0,1)
	v2=AddVertex(surf,-1,1,-1,1,0)
	v3=AddVertex(surf,-1,-1,-1,1,1)
	AddTriangle(surf,v1,v2,v3)
	v4=AddVertex(surf,1,-1,1,1,1)
	v5=AddVertex(surf,1,1,-1,0,5)
	v6=AddVertex(surf,1,-1,-1,0,1)
	AddTriangle(surf,v6,v5,v4)

	;back
	v1=AddVertex(surf,-1,1,-1,0,0)
	v2=AddVertex(surf,1,1,-1,1,0)
	v3=AddVertex(surf,1,-1,-1,1,1)
	v4=AddVertex(surf,-1,-1,-1,0,1)
	AddTriangle(surf,v1,v2,v3)
	AddTriangle(surf,v1,v3,v4)

	;Wedge
	v1=AddVertex(surf,-1,-1,1,1,1)
	v2=AddVertex(surf,1,-1,1,0,1)
	v3=AddVertex(surf,1,1,-1,0,0)
	v4=AddVertex(surf,-1,1,-1,1,0)
	AddTriangle(surf,v1,v2,v3)
	AddTriangle(surf,v1,v3,v4)

	;Bottom
	v1=AddVertex(surf,-1,-1,1,0,1)
	v2=AddVertex(surf,1,-1,1,1,1)
	v3=AddVertex(surf,1,-1,-1,1,0)
	v4=AddVertex(surf,-1,-1,-1,0,0)
	AddTriangle(surf,v3,v2,v1)
	AddTriangle(surf,v3,v1,v4)

	UpdateNormals wedge
	EntityFX wedge,4
	If ParentEntity > 0 Then EntityParent(wedge,ParentEntity)
	Return wedge
End Function

Function CreateSquare(Axis=3,ParentEntity = 0)
;Axis X =1 , Y=2, Z=3
	Square=CreateMesh()
	surf=CreateSurface(Square)
	;Bottom
	v1=AddVertex(surf,-1,0,-1,0,0)
	v2=AddVertex(surf,1,0,-1,1,0)
	v3=AddVertex(surf,1,0,1,1,1)
	v4=AddVertex(surf,-1,0,1,0,1)
	If Axis = 1 Then
		RotateMesh Square,0,0,90
	Else If Axis = 3 Then
		RotateMesh Square,-90,0,0
	End If
	AddTriangle(surf,v3,v2,v1)
	AddTriangle(surf,v3,v1,v4)
	UpdateNormals Square
	EntityFX Square,4
	If ParentEntity > 0 Then EntityParent(Square,ParentEntity)
	Return Square
End Function

Dim Prim_Circle(0)

Function CreateCircle(Segments = 12,Axis=3,ParentEntity = 0)
;Axis X =1 , Y=2,  Z=3
	Circle=CreateMesh()
	surf=CreateSurface(Circle)
	;Bottom
	Dim Prim_Circle(Segments)
	Prim_Circle(0) = AddVertex(surf,0,0,0,.5,.5)
	For S = 1 To Segments
		Angle# = (360/Segments) * (S-1)
		U# = Sin(Angle#)/2 + .5
		V# = Cos(Angle#+180)/2 + .5
		Prim_Circle(S)=AddVertex(surf,Sin(Angle#),0,Cos(Angle#),U,V)
		If s>1 Then
			AddTriangle(surf,Prim_Circle(0),Prim_Circle(s-1),Prim_Circle(s))
		End If 
	Next
	AddTriangle(surf,Prim_Circle(0),Prim_Circle(Segments),Prim_Circle(1))
	
	If Axis = 1 Then
		RotateMesh Circle,0,0,90
	Else If Axis = 3 Then
		RotateMesh Circle,-90,0,0
	End If

	UpdateNormals Circle
	EntityFX Circle,4
	If ParentEntity > 0 Then EntityParent(Circle,ParentEntity)
	Return Circle
End Function


nice work!

Plop it in the code archives, i will do the same!
Just adding better envelope support so any envelope can play on any channel :D

Hey thats a nice game! Good work on the sound. Something I have to get into a little more.

IM just tidying up the sound module then im gona release it on 'ere ^.^ just installing LFOs :D

Ive updated the demo. The game is the same, but anyone who liked the sound system, redownload... ive organised it better and added LFO's ^.^ feel free to use it wherever, whenever. Just credit me okay? ^.^ Catch y'all later.

Dude/dudettes.... I'm afraid it looks like im going to have to back out of this compo- My drive just threw a wobbly and i just lost this weeks work :(...... oh well..


Oh, and now i feel like c**p- i had a right surprise for this comunity coming too :(

well, after some long hours, and a program Eikon recommended, i recovered my lost files... Backing up the rest of the drives now- il do my best to finish this tomorow- Doesnt look likely though!!!!

this is as far as im gona get: So, heres my submission.....

http://www.blitzbasic.com/codearcs/codearcs.php?code=1188

So now that comp is done, we have to figure out how to judge it. I personally think that Cygnus's is the best.

I agree. Cygnus's is the most complete.

Cheers lads! i did throw the last bits together though.... i spent the same amount of time on the sound system and on the game.. :D

I hope everyone else votes for me too! hehe. I hope to see you lots entries soon... i enjoy seeing what others are capable of- usually lots to learn!

Have fun!