Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Simple Challenge: Link vs Goombas

Name: Anonymous 2010-06-07 17:22

Program a game in which the 'player' controls the likeness of Link(Zelda). The objective of the game is to defeat as many 'Goombas'(Mario Bros.) as they can before dieing. The rest is up to you.

Only one factor of your program will be judged: fun-ness.

Get to work!

Name: Anonymous 2010-06-08 12:26

>>39
Beautifully crafted.

Name: Anonymous 2010-06-08 12:36

native java script
swing and a miss

Name: Anonymous 2010-06-08 13:05

>>42
Keeping up on your daily beet toll, I see.

Name: Anonymous 2010-06-08 14:26

>>37-44 this thread breaks the sage record.

Name: Anonymous 2010-06-08 14:28

>>44
The sage record currently stands at 998.

Name: Anonymous 2010-06-08 14:32

>>45
999, actually. http://dis.4chan.org/read/prog/1271321190

There's one thread with 999 sages, five with 998, seven with 997, and five with 996.

Name: Anonymous 2010-06-08 15:00

>>46
no

Name: Anonymous 2010-06-08 15:44

>>47
I used to have a two-year-old like you. Fortunately he grew out of it.

Name: Anonymous 2010-06-08 15:51

>>48
pedo

Name: Anonymous 2010-06-08 15:52

>>49
back to /b/, please.

Name: Anonymous 2010-06-08 16:18

>>48
Small children tend to get larger with age.

Name: Anonymous 2010-06-08 16:24

>>51
Small compilers tend to get larger with age.

Name: Anonymous 2010-06-08 17:07

>>52
Small anuses tend to get larger with age

Name: Anonymous 2010-06-08 18:12

>>33
This is actually quite fun.

Name: Anonymous 2010-06-08 18:55

>>39

enter
sudo apt-get install eclipse

and when you see the text scrolling hit ctrl+c to enter hacker mode

Name: Anonymous 2010-06-08 19:51

Well, this certainly turned out uglier than I anticipated. I may do another one tomorrow.

You'll also need this: http://cairnarvon.rotahall.org/goombarum/sprites.pcx

(Screenshot: http://cairnarvon.rotahall.org/goombarum/screenshot.png )

/* gcc goomba.c `allegro-config --libs` */

#include <stdio.h>
#include <allegro.h>

typedef struct { int x, y; } POS;

int main(void)
{
    BITMAP *sprites, *link, *goomba1, *goomba2, *boom, *cloud, *buffa;
    PALETTE pal;
    extern FONT *font;
    POS link_pos, missiles[5], booms[5], cloud_pos,
        goombas[36];
    int i, flip_alter = 10, clouder = 200,
        going_right = 1, speed = 3,
        booming[5], b_ind = 0,
        score = 0, loser = 1;

    allegro_init();
    install_keyboard();
    install_timer();

    set_color_depth(32);
    if (set_gfx_mode(GFX_AUTODETECT_WINDOWED, 640, 480, 0, 0) != 0) {
        fprintf(stderr, "Couldn't initialise Allegro!\n");
        return 1;
    }
    set_window_title("Goombarum goombis goombis");

    sprites = load_pcx("sprites.pcx", pal);
    if (!sprites) {
        fprintf(stderr, "Couldn't load sprites!\n");
        return 2;
    }


    /* Load sprites */

    link = create_bitmap(22, 32);
    blit(sprites, link, 0, 0, 0, 0, 22, 32);
    goomba1 = create_bitmap(16, 16);
    blit(sprites, goomba1, 22, 0, 0, 0, 16, 16);
    goomba2 = create_bitmap(16, 16);
    blit(sprites, goomba2, 22, 16, 0, 0, 16, 16);
    boom = create_bitmap(32, 32);
    blit(sprites, boom, 38, 0, 0, 0, 32, 32);
    cloud = create_bitmap(16, 32);
    blit(sprites, cloud, 70, 0, 0, 0, 16, 32);

    destroy_bitmap(sprites);
    buffa = create_bitmap(SCREEN_W, SCREEN_H);


    /* Position everything */

    link_pos.x = SCREEN_W / 2;
    link_pos.y = SCREEN_H - 41;

    for (i = 0; i < 5; ++i) {
        missiles[i].x = missiles[i].y = -1;
        booms[i] = missiles[i];
        booming[i] = 0;
    }

    for (i = 0; i < 12; ++i) {
        goombas[i].x = goombas[i + 24].x = 32 + 32 * i;
        goombas[i + 12].x = 16 + 32 * i;
        goombas[i].y = 68;
        goombas[i + 12].y = 100;
        goombas[i + 24].y = 132;
    }

    cloud_pos.x = -10;
    cloud_pos.y = 0;


    /* Main loop */

    for (;;) {
        int alter = flip_alter > 5, live = 0, max_left = 640, max_right = 0;
       
        /* Paint current game state */

        clear_to_color(buffa, makecol(0, 200, 0));

        for (i = 0; i < 5; ++i) {
            if (missiles[i].x >= 0)
                circlefill(buffa,
                           missiles[i].x, missiles[i].y, 2,
                           makecol(255, 0, 0));
            if (booming[i] > 0)
                draw_sprite(buffa, boom, booms[i].x - 16, booms[i].y - 16);
        }

        draw_sprite(buffa, link, link_pos.x - 11, link_pos.y);

        for (i = 0; i < 12; ++i) {
            if (goombas[i].x >= 0)
                draw_sprite(buffa,
                            alter ? goomba1 : goomba2,
                            goombas[i].x - 8,
                            goombas[i].y - 8);
            if (goombas[i + 24].x >= 0)
                draw_sprite(buffa,
                            alter ? goomba1 : goomba2,
                            goombas[i + 24].x - 8,
                            goombas[i + 24].y - 8);
            alter = !alter;
            if (goombas[i + 12].x >= 0)
                draw_sprite(buffa,
                            alter ? goomba1 : goomba2,
                            goombas[i + 12].x - 8,
                            goombas[i + 12].y - 8);
        }

        textprintf_ex(buffa, font, 0, 0,
                      makecol(255, 255, 255), makecol(0, 0, 0),
                      "Score: %d", score);

        if (cloud_pos.x >= -8)
            draw_sprite(buffa, cloud, cloud_pos.x - 8, 0);

        blit(buffa, screen, 0, 0, 0, 0, SCREEN_W, SCREEN_H);


        /* Update game state */

        if (--flip_alter == 0) flip_alter = 10;

        if (keypressed()) {
            int k = readkey();

            if ((k & 0xff) == 'q')
                break;

            switch (k >> 8) {
            case KEY_SPACE:
                for (i = 0; i < 5; ++i) {
                    if (missiles[i].x < 0) {
                        missiles[i] = link_pos;
                        break;
                    }
                }
                break;
            case KEY_LEFT:
                if (link_pos.x > 27)
                    link_pos.x -= 5;
                break;
            case KEY_RIGHT:
                if (link_pos.x < SCREEN_W - 27)
                    link_pos.x += 5;
            }
            clear_keybuf();
        }

        for (i = 0; i < 36; ++i) {
            if (goombas[i].x >= 0) {
                int killed = 0, j;

                for (j = 0; j < 5; ++j) {
                    int xd = goombas[i].x - missiles[j].x,
                        yd = goombas[i].y - missiles[j].y;

                    if (xd >= -16 && xd <= 16 && yd >= -16 && yd <= 16) {
                        booms[b_ind] = goombas[i];
                        booming[b_ind] = 16;
                        ++b_ind;
                        b_ind %= 5;

                        goombas[i].x = goombas[i].y = -1;
                        missiles[j] = goombas[i];

                        ++killed;
                        ++speed;

                        score += 100 * speed;

                        fprintf(stderr, "Killed Goomba #%d!\n", i);

                        break;
                    }
                }

                if (!killed) {
                    goombas[i].x += going_right ? speed / 3 : -speed / 3;
                    if (goombas[i].x < max_left)  max_left  = goombas[i].x;
                    if (goombas[i].x > max_right) max_right = goombas[i].x;
                    ++live;
                }
            }
        }

        if (live == 0) {
            loser = 0;
            break;
        }

        if ((going_right && max_right > SCREEN_W - 32) ||
            (!going_right && max_left < 32)) {
            int max_down = 0;

            going_right = !going_right;

            for (i = 0; i < 36; ++i) {
                goombas[i].y += 16;
                if (goombas[i].y > max_down) max_down = goombas[i].y;
            }

            if (max_down > SCREEN_H - 50)
                break;
        }

        for (i = 0; i < 5; ++i) {
            if (missiles[i].x >= 0) {
                if (cloud_pos.x >= -8 && missiles[i].y < 32) {
                    int dx = missiles[i].x - cloud_pos.x;

                    if (dx >= -8 && dx <= 8) {
                        booms[b_ind].x = cloud_pos.x;
                        booms[b_ind].y = 16;
                        booming[b_ind] = 30;
                        ++b_ind;
                        b_ind %= 5;

                        missiles[i].y = 0;
                        cloud_pos.x = -10;
                        clouder = 400;

                        score += 5000;
                    }
                }

                missiles[i].y -= 5;
                if (missiles[i].y < 0) missiles[i].x = -1;
            }
            --booming[i];
        }

        if (cloud_pos.x >= -8) {
            cloud_pos.x += 6;
            if (cloud_pos.x > SCREEN_W + 8) {
                cloud_pos.x = -10;
                clouder = 200;
            }
        }

        --clouder;
        if (clouder == 0)
            cloud_pos.x = -8;

        rest(25);
    }

    textout_centre_ex(screen, font, loser ? "YOUR JAMES OVER" : "WINRAR",
                      SCREEN_W / 2, SCREEN_H / 2,
                      makecol(255, 255, 255), -1);

    clear_keybuf();
    while (!keypressed());

    return 0;
}

Name: Xarn Fan !AWEsomEEEE 2010-06-08 20:21

>>56
Yay!

Name: Anonymous 2010-06-08 23:14

>>57

Jesus {i[i] Christ} look at that trypcode

Name: Anonymous 2010-06-09 0:47

>>57-58
No one cares.

Name: Anonymous 2010-06-09 2:03

>>59
I care. Its a nice trip-code. Why do you have to be so negative all the time?

Name: Anonymous 2010-06-09 2:05

>>59
Xarn post? Everyone cares. Everyone loves Xarn. ^_^

BAMPU XARNAE

Name: Anonymous 2010-06-09 2:27

Who is Xarn anyway?

Name: Anonymous 2010-06-09 2:33

>>62
Erika's husband.

Name: Anonymous 2010-06-09 2:45

GOOMBÆ

Name: Anonymous 2010-06-09 3:32

I would post mine, but its too big to fit in a single toast so I'm just gonna bread and butter.

Name: Anonymous 2010-06-09 9:12

>>65
toast
You don't even know how to code, you just wandered in from the imageboards.

Name: Anonymous 2010-06-09 14:17

>>66
Yeah I can. Check this out:


 <div class="hborder">
     <div class="head midhead options">
         <strong>Style:</strong> <a href="prog/#" onclick="setActiveStyleSheet('Yotsuba'); return false;">Yotsuba</a>,
         <a href="prog/#" onclick="setActiveStyleSheet('Pseud0ch'); return false;">Pseud0ch</a>,
         <a href="prog/#" onclick="setActiveStyleSheet('Terminal'); return false;">Terminal</a>

        &nbsp;
         <div class="navmenus">
    <strong>Navigation:</strong>

Name: Anonymous 2010-06-09 14:33

>>66
Me too <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>4chan BBS - Programming</title>
<base href="http://dis.4chan.org/" />
<meta http-equiv="Cache-control" content="must-revalidate" />
<meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
<meta name="description" content="/prog/ is 4chan's BBS for computer programming."/>
<meta name="keywords" content="bbs,computers,software,programming,php,perl,html,sql,python,ruby"/>
<meta name="robots" content="noarchive" />
<link rel="alternate" title="Atom feed" href="atom/prog" type="application/atom+xml" />
<link rel="stylesheet" href="http://static.4chan.org/css/dis/world4ch/global.css" />
<link rel="stylesheet" href="http://static.4chan.org/css/dis/world4ch/0ch.css" title="Pseud0ch" media="screen"/>
<link rel="alternate stylesheet" href="http://static.4chan.org/css/dis/world4ch/yotsuba.css" title="Yotsuba" media="screen" />
<link rel="alternate stylesheet" href="http://static.4chan.org/css/dis/world4ch/terminal.css" title="Terminal" media="screen" />
<link rel="stylesheet" href="http://static.4chan.org/css/dis/world4ch/print.css" media="print"/>
<link rel="shortcut icon" href="http://static.4chan.org/image/favicon-dis.ico" />

<script type="text/javascript" src="http://static.4chan.org/js/dis/styleswitcher.js"></script>
<script type="text/javascript" src="http://static.4chan.org/js/dis/global.js"></script>

</head>
<body class="board">

  <div class="hborder">
    <div class="head">
    <div class="headtext">
      <h1>Programming</h1>

     
    </div>
    </div>
  </div>


 <div class="hborder">
     <div class="head midhead options">
         <strong>Style:</strong> <a href="prog/#" onclick="setActiveStyleSheet('Yotsuba'); return false;">Yotsuba</a>,
         <a href="prog/#" onclick="setActiveStyleSheet('Pseud0ch'); return false;">Pseud0ch</a>,
         <a href="prog/#" onclick="setActiveStyleSheet('Terminal'); return false;">Terminal</a>

        &nbsp;
         <div class="navmenus">
    <strong>Navigation:</strong>

    <form action="derefer" method="get">
    <select name="url" onchange="doMenuNav(this.options[this.selectedIndex].value)">
    <option value="">Text Boards</option>
    <hr/>
    <option value="anime/">/anime/ - Anime &amp; Manga</option>

    <option value="book/">/book/ - Books</option>
    <option value="carcom/">/carcom/ - Comics &amp; Cartoons</option>
    <option value="comp/">/comp/ - Computers</option>
    <option value="food/">/food/ - Food</option>
    <option value="games/">/games/ - Video Games</option>

    <option value="img/">/img/ - Imageboard Discussion</option>
    <option value="lang/">/lang/ - Foreign Language</option>
    <option value="lounge/">/lounge/ - Lounge</option>
    <option value="music/">/music/ - Music</option>
    <option value="newnew/">/newnew/ - World News</option>
    <option value="newpol/">/newpol/ - Politics</option>

    <option value="prog/">/prog/ - Programming</option>
    <option value="sci/">/sci/ - Science &amp; Math</option>
    <option value="sjis/">/sjis/ - SJIS Room</option>
    <option value="sports/">/sports/ - Sports</option>
    <option value="tech/">/tech/ - Technology</option>

    <option value="tele/">/tele/ - Television &amp; Film</option>
    <option value="vip/">/vip/ - News for VIP</option>
   
    </select>
    </form>
   
   
    <form action="derefer" method="get">
    <select name="url" onchange="doMenuNav(this.options[this.selectedIndex].value)">
   
    <option value="">Image Boards</option>

    <hr/>
    <option value="http://boards.4chan.org/a/">/a/ - Anime &amp; Manga</option>
    <option value="http://boards.4chan.org/b/">/b/ - Random</option>
    <option value="http://boards.4chan.org/c/">/c/ - Anime/Cute</option>
    <option value="http://boards.4chan.org/d/">/d/ - Hentai/Alternative</option>
    <option value="http://boards.4chan.org/e/">/e/ - Ecchi</option>

    <option value="http://boards.4chan.org/f/">/f/ - Flash</option>
    <option value="http://boards.4chan.org/g/">/g/ - Technology</option>
    <option value="http://boards.4chan.org/gif/">/gif/ - Animated GIF</option>
    <option value="http://boards.4chan.org/h/">/h/ - Hentai</option>
    <option value="http://boards.4chan.org/hr/">/hr/ - High Resolution</option>
    <option value="http://boards.4chan.org/k/">/k/ - Weapons</option>

    <option value="http://boards.4chan.org/m/">/m/ - Mecha</option>
    <option value="http://boards.4chan.org/o/">/o/ - Auto</option>
    <option value="http://boards.4chan.org/p/">/p/ - Photo</option>
    <option value="http://boards.4chan.org/r/">/r/ - Request</option>
    <option value="http://boards.4chan.org/s/">/s/ - Sexy Beautiful Women</option>
    <option value="http://boards.4chan.org/t/">/t/ - Torrents</option>

    <option value="http://boards.4chan.org/u/">/u/ - Yuri</option>
    <option value="http://boards.4chan.org/v/">/v/ - Video Games</option>
    <option value="http://boards.4chan.org/w/">/w/ - Anime/Wallpapers</option>
    <option value="http://boards.4chan.org/wg/">/wg/ - Wallpapers/General</option>
    <hr/>
    <option value="http://boards.4chan.org/i/">/i/ - Oekaki</option>

    <option value="http://boards.4chan.org/ic/">/ic/ - Artwork/Critique</option>
    <hr/>
    <option value="http://boards.4chan.org/cm/">/cm/ - Cute/Male</option>
    <option value="http://boards.4chan.org/y/">/y/ - Yaoi</option>
    <hr/>
    <option value="http://boards.4chan.org/r9k/">/r9k/ - ROBOT9000</option>
    <hr/>

    <option value="http://boards.4chan.org/3/">/3/ - 3DCG</option>
    <option value="http://boards.4chan.org/adv/">/adv/ - Advice</option>
    <option value="http://boards.4chan.org/an/">/an/ - Animals &amp; Nature</option>
    <option value="http://boards.4chan.org/cgl/">/cgl/ - Cosplay &amp; EGL</option>
    <option value="http://boards.4chan.org/ck/">/ck/ - Food &amp; Cooking</option>

    <option value="http://boards.4chan.org/co/">/co/ - Comics &amp; Cartoons</option>
    <option value="http://boards.4chan.org/fa/">/fa/ - Fashion</option>
    <option value="http://boards.4chan.org/fit/">/fit/ - Health &amp; Fitness</option>
    <option value="http://boards.4chan.org/int/">/int/ - International</option>
    <option value="http://boards.4chan.org/jp/">/jp/ - Otaku Culture</option>

    <option value="http://boards.4chan.org/lit/">/lit/ - Literature</option>
    <option value="http://boards.4chan.org/mu/">/mu/ - Music</option>
    <option value="http://boards.4chan.org/n/">/n/ - Transportation</option>
    <option value="http://boards.4chan.org/new/">/new/ - News</option>
    <option value="http://boards.4chan.org/po/">/po/ - Papercraft &amp; Origami</option>

    <option value="http://boards.4chan.org/sci/">/sci/ - Science &amp; Math</option>
    <option value="http://boards.4chan.org/sp/">/sp/ - Sports</option>
    <option value="http://boards.4chan.org/tg/">/tg/ - Traditional Games</option>
    <option value="http://boards.4chan.org/toy/">/toy/ - Toys</option>
    <option value="http://boards.4chan.org/trv/">/trv/ - Travel</option>

    <option value="http://boards.4chan.org/tv/">/tv/ - Television &amp; Film</option>
    <option value="http://boards.4chan.org/x/">/x/ - Paranormal</option>
    <hr/>
    <option value="http://rs.4chan.org/">/rs/ - Rapidshares</option>
    <hr/>
    <option value="http://status.4chan.org/">/status/ - 4chan Status</option>

    <option value="http://formspring.me/4chan">/?/ - 4chan Q&amp;A</option>
    <option value="http://twitter.com/4chan">/@/ - 4chan Twitter</option>
   
    </select>
    </form>
   
</div>
     </div>
 </div>

 <div class="hborder">
  <div class="head threadldiv">

Name: Anonymous 2010-06-09 14:42

Every thread turns to shit in June. At least we tried.

Name: Anonymous 2010-06-09 17:38

>>69
So that the room will be empty.

Name: Anonymous 2010-06-09 19:02

Belgium passed the deadline an hour ago, so I don't think Xarn is going to be submitting a second entry.

Name: Anonymous 2010-06-09 20:42

Bampu. Let's keep this on the front page until the deadline is reached.

Name: Anonymous 2010-06-09 23:13

Just found this thread... I have a date in an hour, I'll start making it when I come back.

Name: Anonymous 2010-06-10 5:34

>>73
"No I can't have sex with you I have to write a program for my anonymous friends"

Name: Anonymous 2010-06-10 11:07

So, is this over? Who won?
Suspense!

Name: Anonymous 2010-06-10 11:20

>>75
Sadly, Xarn always wins ):

Name: OP 2010-06-10 11:45

This was fucking easy.

#The winner: >>56 Xarn

Name: Anonymous 2010-06-10 12:11

[mail]OP[/mail]

Name: Anonymous 2010-06-10 12:45

>>77
This deserves a BAMPU XARNAE.

Name: Anonymous 2010-06-10 13:10

V·MENA·BAMPV·XARNÆ

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List