Show us yer programming projects!

Coders forum. Discuss techniques, swap code snippets, ask for help etc. relating to all forms of software development.
Post Reply
User avatar
GoatFoam
Baaaaa!
Baaaaa!
Posts: 1255
Joined: Tue Dec 12, 2006 11:05 am 0
Location: Brizzle
Contact:

Post by GoatFoam »

Guess what sort of game I am working on at the moment. To make it harder I have removed most of the comments.

Bonus points if you can name the language.

Code: Select all

update(World, Time) ->
    {M, E} = World,
    E2 = live_explosions(E, Time),
    DeadExplosions = dead_explosions(E, Time),
    EC = lists:map(explosion_radius(Time), E2), % tuples of {X, Y, R}
     Arrived = arrived_missiles(M, Time),
    M2 = live_missiles(M, Time),
    {Destroyed, ActiveMissiles} = test_collisions(EC, M2, Time),
      SurfaceHits = find_surface_targets(Arrived),
     DeadMissiles = lists:append([Destroyed, Arrived]),
    NewExplosions = lists:map(missile_to_explosion(Time, 5, 10), DeadMissiles),
    AllExplosions = lists:append(NewExplosions, E2),
    % Build return value.
    NewWorld = {ActiveMissiles, AllExplosions},
    Events = {DeadMissiles, DeadExplosions, NewExplosions, SurfaceHits},
    {NewWorld, Events}.
[/code]
User avatar
PaulCunningham
Baaaaa!
Baaaaa!
Posts: 1218
Joined: Sun Jan 18, 2004 11:47 pm 0
Location: Walsall, England
Contact:

Post by PaulCunningham »

Me, me!

Missile Command.
Cheers,
Paul Cunningham
Pumpkin Games
User avatar
GoatFoam
Baaaaa!
Baaaaa!
Posts: 1255
Joined: Tue Dec 12, 2006 11:05 am 0
Location: Brizzle
Contact:

Post by GoatFoam »

PaulCunningham wrote:Me, me!

Missile Command.
And the language?
User avatar
Dvorak
Baaaaaa!
Baaaaaa!
Posts: 4560
Joined: Wed May 08, 2002 7:37 am 0
Yahoo Messenger: d3dxquaternion
Location: Germany

Post by Dvorak »

Erlang

EDIT: as could be recognised easily by the "wrong" direction of the arrow ->
I designed a Prolog dialect once and, strangely enough, decided to use the wrong direction for that, too. Still having qualms because of that.
>take off sunglasses
Seamen and fishermen alike swear to have heard voices in the rising tide. Inhuman screams, some of them say.
User avatar
piku
Sheepie Whore
Sheepie Whore
Posts: 20960
Joined: Wed Apr 24, 2002 10:44 am 0
Website: Http://Www.ncot.uk
Location: Wakefield
Contact:

Post by piku »

Dvorak wrote:Erlang
Brainfuck.

Somehow I need to invent about six more hours in the day for personal coding. My N800 is in serious need of some games I can play on the bog. There's a disturbing lack of match-three games, it's unreal.
return (0);
User avatar
GoatFoam
Baaaaa!
Baaaaa!
Posts: 1255
Joined: Tue Dec 12, 2006 11:05 am 0
Location: Brizzle
Contact:

Post by GoatFoam »

piku wrote: Brainfuck.
Now writing a game in brainfuck is a challenge worth trying.
User avatar
piku
Sheepie Whore
Sheepie Whore
Posts: 20960
Joined: Wed Apr 24, 2002 10:44 am 0
Website: Http://Www.ncot.uk
Location: Wakefield
Contact:

Post by piku »

I just "ported" (read that as "just compiled it in the devkit") FBZX, the Spectrum emulator to my N800.

Now... how to control a keyboard based computer using a device that has no keyboard. :?
return (0);
User avatar
moosedude
Baaaaaaa!
Baaaaaaa!
Posts: 6209
Joined: Fri Nov 19, 2004 1:19 pm 0
Location: Craggy Island
Contact:

Post by moosedude »

Just done some new work on my HSR algorithm, quite please with it, still needs testing, but first I need to build something to test it with.

Its an attempt at classifying objects based on their relative position and size to each other, rather than a more formula structure, such as an Octree. Initial results look quite positive. My aim is to be able to move objects freely around this structure without a large performance overhead, the factor that might limit this is the recursive nature of the main function itself. I think I might be able to modify this by adding a generic move functions (rather than calling delete, add each time a object moves) which takes a direction vector as input and "predicts" where the object might be, and assessing whether the object needs to move from node to node or not.

Thats far down the line, won't visit this again until some other stuff is finished first, such as my character animation application and my wavelets stuff, which has been sidelined for a bit, on account of that I need to do some more reading. :-)

01000101 01000100 01000111 01000101

http://www.redbubble.com/people/fotofill/ buy my photos!
User avatar
The Caffeine Kid
Baaaaaaa!
Baaaaaaa!
Posts: 5691
Joined: Mon Mar 01, 2004 9:24 pm 0
XBL Gamertag: TheCaffeineKid
PSN: caffeinekid
Yahoo Messenger: caffeinekid
Location: Wakefield
Contact:

Post by The Caffeine Kid »

Not done much coding for a long while but just spent the last (almost) week on a remake of a little known Atari ST public domain game called Duck Dash.

Just finished it this evening and put it up on my site. It's very simple and probably most fun for kids. Did it cause my friend ripped the graphics last Friday and said it might be a bit of practice to get back into coding.

Image

Avoid the baddies and collect the eggs (and fruit if you are quick enough).

http://tcksoft.co.uk/download.php?view.19
Life... Don't talk to me about life...

http://www.tcksoft.co.uk
http://www.retroremakes.com
User avatar
Barney
Baaaaaa!
Baaaaaa!
Posts: 2131
Joined: Tue Aug 23, 2005 7:59 pm 0
Location: UK, Broughton, Brigg

Post by Barney »

While we're on about Brainfuck...

Here's my interpreter in Sinclair BASIC :-)

Code: Select all

  10 REM Brainfuck Interpreter By Paul Dunn
  20 CLEAR PEEK 23675+256*PEEK 23676-30020
  30 LET e=0
  40 LET c$="++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>."
  50 LET p=20+PEEK 23730+256*PEEK 23731: GO SUB 500
 100 LET e=e+1: IF e>LEN c$ THEN STOP
 110 IF c$(e)="+" THEN POKE p,PEEK p+1-(255*(PEEK p=255)): GO TO 100
 120 IF c$(e)=">" THEN LET p=p+1: GO TO 100
 130 IF c$(e)="<" THEN LET p=p-1: GO TO 100
 140 IF c$(e)="-" THEN POKE p,PEEK p-1+(255*(PEEK p=0)): GO TO 100
 150 IF c$(e)="." THEN PRINT CHR$ PEEK p;: GO TO 100
 160 IF c$(e)="," THEN INPUT b$: POKE p,CODE b$: GO TO 100
 170 IF c$(e)="[" THEN IF PEEK p=0 THEN GO SUB 200: GO TO 100
 180 IF c$(e)="]" THEN IF PEEK p<>0 THEN GO SUB 300: GO TO 110
 190 GO TO 100
 200 LET b=1
 210 LET e=e+1: IF c$(e)="[" THEN LET b=b+1
 220 IF c$(e)="]" THEN LET b=b-1: IF b=0 THEN RETURN
 230 GO TO 220
 300 LET b=1
 310 LET e=e-1: IF c$(e)="]" THEN LET b=b+1
 320 IF c$(e)="[" THEN LET b=b-1: IF b=0 THEN RETURN
 330 GO TO 310
 500 RESTORE 510: FOR b=p-20 TO p-2: READ e: POKE b,e: NEXT b: RANDOMIZE USR (p-20): LET e=0: RETURN
 510 DATA 237,91,178,92,33,20,0,25,1,48,117,84,93,54,0,19,237,176,201
The m/c at the end is just a fast way of clearing the 30kb of memory used. The actual bf program code is in c$ in line 40.
User avatar
piku
Sheepie Whore
Sheepie Whore
Posts: 20960
Joined: Wed Apr 24, 2002 10:44 am 0
Website: Http://Www.ncot.uk
Location: Wakefield
Contact:

Post by piku »

The Caffeine Kid wrote:Not done much coding for a long while but just spent the last (almost) week on a remake of a little known Atari ST public domain game called Duck Dash.
I think I've played that :)
return (0);
User avatar
Orangy Tang
Baaaaa!
Baaaaa!
Posts: 1794
Joined: Sun Apr 25, 2004 5:25 pm 0
Location: My secret lab
Contact:

Post by Orangy Tang »

I'm currently working on this:

Image

Started it at xmas, and it's comming along nicely. I'm aiming to have something for people here to play in a week or so. :D
[ Triangular Pixels.net - play Snowman Village, Rescue Squad, NiGHTS 4k and more ] [ Development Journal ]
User avatar
the2bears
Baaaaaa!
Baaaaaa!
Posts: 3686
Joined: Wed Oct 27, 2004 9:30 pm 0
Location: The City by the Bay
Contact:

Post by the2bears »

Orangy Tang,

That's looking pretty cool!

Bill
the2bears - the indie shmup blog
User avatar
_TinOmen_
Baaaa!
Baaaa!
Posts: 745
Joined: Wed Feb 12, 2003 10:52 pm 0
Location: Stockholm, Sweden
Contact:

Post by _TinOmen_ »

Barney wrote:While we're on about Brainfuck...

Here's my interpreter in Sinclair BASIC :-)
That's really clever :D
User avatar
RatZiggurat
Baa!
Baa!
Posts: 96
Joined: Sun Feb 02, 2003 6:45 am 0
Location: Canada
Contact:

Post by RatZiggurat »

As much as people harp on about oldskool BASIC being crap, and line numbers and GOTOs being the spawn of the devil, I always find that line-numbered code really easy to read and follow. :) It maps well to the mind, in a linear, addressable fashion.
Post Reply