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

Code snippet from Japanese shoot-em-up game

Name: Anonymous 2010-08-16 19:00

void t13()
{
    z1=jiki[9]*4;
    if(hant(jiki[0]+ENHnt[z1]*100-6000,jiki[1]+ENHnt[z1+1]*100-6000,ENHnt[z1+2]+120,ENHnt[z1+3]+120,ex-200,ey-200,4,4))
    {
        SIN(nel(mid(1,0,0)-ey,ex-mid(0,0,0)),(abs(exx)+abs(eyy))/8+300);
        exx=exx+sinx;
        eyy=eyy+siny;
    }
    if(ex+exx<    0){ex=    0;exx= abs(exx);}
    if(ex+exx>40000){ex=40000;exx=-abs(exx);}
    if(ey+eyy<    0){ey=    0;eyy= abs(eyy);}
    if(ey+eyy>48000){ey=48000;eyy=-abs(eyy);}

    ec++;
    alt{
    case e7==0:
        {
            if(ec==1)
            {
                ep[0]=nLimit(6+lev,16);
                ep[1]=nLimit(3+lev/2,8);
                ep[2]=LLim(4+150/(lev+5)-lev/10,1);
                ep[3]=ep[0]+ep[2];
            }
            exx=(exx+sgn(mid(0,0,0)-ex)*3)+rndpm(20);
            eyy=(eyy+sgn(mid(1,0,0)-ey)*3)+rndpm(20);
            if((ec>60)&&(ec<480+480%ep[3]))
            {
                if(ec%ep[3]==0)
                {
                    ep[4]=(mid(0,0,0)+ex)/2;
                    ep[5]=(mid(1,0,0)+ey)/2;
                }
                if(ec%ep[3]<ep[0])ebhas1(eblim(ep[1]),0,nLimit(1+(lev+4)/6,4),ex,ey,nel(ey-ep[5],ep[4]-ex),0,ebsp,ebsp/4);
            }
            if(ec>560+480%ep[3])
            {
                for(i=0;i<256;i++)ep[i]=0;
                ec=0;e7++;ejmuteki=1;
            }
        }
    case e7==1:
        {
            exx=(exx+sgn(mid(0,0,0)-ex)*2)+rndpm(55);
            eyy=(eyy+sgn(mid(1,0,0)-ey)*2)+rndpm(55);
            if(ec<600)
            {
                if(ec%(12-nLimit(lev/3,9))==0)ebhas1(eblim(1),0,7,ex,ey,nel(ey-mid(1,0,0),mid(0,0,0)-ex),0,0,0);
                if(ec%((30-nLimit(lev*2,25))*2)==0)
                {
                    z1=nLimit(2+lev,12)+lev/8;
                    for(i=0;i<z1;i++)ebhas1(eblim(2),0,11,ex,ey,nel(ey-mid(1,0,0),mid(0,0,0)-ex),1640-i*60,ebsp*(1+z1-i)/5,0);
                }
            }
            if(ec>700){e7++;ec=0;}
        }
    case e7==2:
        {
            if(ec<600)
            {
                exx=exx*99/100;
                eyy=eyy*99/100;
            }
            else
            {
                exx=(exx-sgn(mid(0,0,0)-ex)*6)+rndpm(65);
                eyy=(eyy-sgn(mid(1,0,0)-ey)*6)+rndpm(65);
            }
            if(ec==1)
            {
                ejmuteki=0;
                z1=1+(lev>6);
                for(i=EBSP;i!=-1;i=eb[i*B+19])if(eb[i*B+4]!=0)if(eb[i*B+15]==7){ebhas1(eblim(z1),1,16,eb[i*B],eb[i*B+1],eb[i*B+7],3600/z1,100,0);eb[i*B]=-128000;}
            }
            if(((exx==0)&&(eyy==0)&&(ec<400))||((ec>599)&&(ec<801)))ebhas1(eblim(1+nLimit(lev/4,4)),1,15,ex,ey,rnd(3600),0,200,-40);
            if((eblim(EB)==EB)&&(((ec>400)&&(ec<600))||(ec>800))){e7=0;lev++;ec=0;}
        }
    }
}


Well, shit.

Name: 1 2010-08-16 19:03

Have some more. http://pastebin.com/wM4mTpUp

if(i== 1)if(cnf[2]>0)
I just don't know.

Name: Anonymous 2010-08-16 19:28

jump(en,mv,mv,mv,mv,mv,mv,mv,nm,mv,mv,
                        mv,mv,mv,nm,mv,mv,nm,nm,nm,nm,
                        nm,nm,nm,mv,mv,mv,mv,nm,nm,nm,
                        nm,nm,nm,mv,nm,mv,mv,mv,nm,nm,
                        nm,nm,nm,nm,nm,nm,nm,nm,nm,nm,
                        nm,nm,nm,nm,nm,nm,nm,nm,nm,nm,
                        nm,nm,nm,nm,nm,nm,nm,nm,nm,nm);


huh

Name: Anonymous 2010-08-16 19:29

my ancestors are rolling in their graves right now

Name: Anonymous 2010-08-16 19:34

VALID PERL CODE

Name: Anonymous 2010-08-16 20:09

void cnfsave()
I knew it. This kind of store-the-state-in-an-array code is usually begotten because someone wants to be clever and simplify saving/loading.
And always with magic numbers, because that's how it was done in BASIC, where they first learned the technique.

Name: Anonymous 2010-08-16 20:15

That is some of the shittiest code I've ever seen.

Name: Anonymous 2010-08-16 20:17

>>7
Read FV's blog.

Name: Anonymous 2010-08-16 20:20

>>8
Who is FV?

Name: Anonymous 2010-08-16 21:36

What game is this from?

After all, rather than being a /prog/ elitist, I would like to test the actual functionality.

Name: Anonymous 2010-08-16 21:44

>>9
FrozenVoid.

Name: Anonymous 2010-08-16 21:57

>>10
Touhou?

Name: Anonymous 2010-08-17 2:09

This stuff is painful to read.

Name: Anonymous 2010-08-17 2:54

>>8
Please post his blog's address.

Name: Anonymous 2010-08-17 3:12

>>14
Please learn how to use /prog/scrape and/or Google.

Name: Anonymous 2010-08-17 3:16

>>15
Please fuck off, Xarn. I won't install FIOC just to use your shit.

Name: Anonymous 2010-08-17 3:24

>>16
Back to /pr/, please.

Name: Anonymous 2010-08-17 4:05

So this is why porn games from Japan are usually s l o w a s f  u c k.

Name: Anonymous 2010-08-17 7:01

>>10,12

Nope. YGS2000. The game works really well, google it. Just don't look in the "script" folder.

Name: Anonymous 2010-08-18 2:43

Official /prog/ Challenge!
Make a Japanese shoot-em-up game.

Name: Anonymous 2010-08-18 2:56

>>20
Don't you have to be Japanese for that?

Name: >>21 2010-08-18 2:57

And if you're Japanese, won't you be forced to use Ruby?

Name: Anonymous 2010-08-18 4:12

I had a Japanese professor for a couple CS classes and noticed he like 2-5 letter variable wherever possible, often giving things that should have been "blockOn" names like blkn

Name: Anonymous 2010-08-18 5:18

It conserves valuable screen estate.

Name: Anonymous 2010-08-18 11:53

>>23
Even poorly named variables are better than shitCase.

Name: Anonymous 2010-08-18 12:18

>>23,25
block_on
CODE TAGS ARE USED FOR CODE SNIPPETS

Name: Anonymous 2010-08-18 12:52

This code looks like collision or interaction with an object in screen.

...Just a guess...

Name: Anonymous 2010-08-18 12:56

I had a Nipponese sensei for a couple of conpyuta sciensu classes and noticed he like the dibagga wherever possible, often giving things that should have been "traceOn" names like yelling TRACE ON!!! and jamming his p○n○s into my vag○○○ to replenish my magic

Name: Anonymous 2010-08-18 14:57

>>25
Why not go Hungarian and get the worst of both worlds?

Name: Anonymous 2010-08-18 15:32

>>29
s/Hungarian/Systems Hungarian/

Name: Anonymous 2010-08-18 18:57

>>26
THE BLOCK ON

Name: Anonymous 2010-08-18 22:14

Is that C? What the fuck is going on with those case statements?

Name: Anonymous 2010-08-18 23:12

>>32
You can use curly braces to delimit blocks even outside of the usual places. Most people don't, though.

Name: Anonymous 2010-08-19 1:34

>>21
No, you just have to make it in Japan.

Name: Anonymous 2010-08-19 3:48

>>35
Is that even relevant to this thread, or just your way of saying ``I have read SICP to learn how to write spam bots''?

Name: Anonymous 2010-08-19 3:52

>>1
At first glance, I thought this was C, but what the hell is an alt statement?  And why do all the case statements look like:
case e7==something: where "e7" is not defined anywhere?

Name: Anonymous 2010-08-19 3:57

>>37
Macros and globals respectively. It's only a snippet.

Name: Anonymous 2010-08-19 4:23

>>33
I'm not talking about the braces dumbass. I'm talking about case e7==0:. That is completely fucked. Without macros, that's a boolean, and there are only two values of it. Cases cannot be repeated and have to be compile-time constants.

The only way this can compile as C is if e7 is some crazy-ass macro. The case statements also have no breaks, so unless case is also overridden, or e7 contains a break and opens a new case, then all these case statements fall through.

>>38
You're going to need to give us the macros for alt and e7, and possibly case as well if it's overridden by a macro.

Name: Anonymous 2010-08-19 4:39

>>39
I'm not talking about the braces dumbass. I'm talking about case e7==0:. That is completely fucked. Without macros, that's a boolean, and there are only two values of it.
Maybe you should actually look up how C works.

Cases cannot be repeated and have to be compile-time constants.


Maybe you should also look up how labels work in general.

Anyway.
Did Satoshi Nishimura write this code? Sure looks like his.

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