[ home / overboard ] [ date ] [ soy / qa / raid / incel ] [ int / pol ] [ a / biz / fit / mtv / r9k / sude / tech / v / x ] [ q / news / chive / rules / pass / bans / status ] [ booru / wiki ]

A banner for soyjak.party

/pol/ - International /Pol/itics & /Bant/er

Politics & countrywars
Catalog
Name
Email
Subject
Comment
Flag
File
Password (For file deletion.)

File: pepe_smalleyes.webp 📥︎ (9.72 KB, 716x652) ImgOps

File: ClipboardImage.png 📥︎ (55.2 KB, 878x751) ImgOps

 â„–4289550[Quote]

can nusois rate my GML code?

 â„–4289558[Quote]

is it worse than Pirate Software's code?

 â„–4289563[Quote]

janny there's nothing to approve.

 â„–4289569[Quote]

NO NU TOSSES WILL EVER BE POSTED AGAIN
everything will remain an anprovol

 â„–4289576[Quote]

File: YTPH El Chavo del 7 más p….mp4 📥︎ (13.65 MB, 480x360) ImgOps

File: Screenshot_247.png 📥︎ (470.84 KB, 1330x873) ImgOps

Go read Atemporal at /qa/ to own ukraine blud

 â„–4289581[Quote]

>>4289576
i am interested in getting rated for my code.

 â„–4289587[Quote]

bump

 â„–4289598[Quote]

i will not be ignored.

 â„–4289603[Quote]

snca

 â„–4289606[Quote]

>>4289603
do you like that it's a bunch of if statements and switch cases or should I aabstract it away somehow?

 â„–4289628[Quote]

i just started programming a week ago.
looks good to me!

 â„–4289632[Quote]

>>4289628
so it's an object inherited from the main Character object and this particular piece handles everything that happens every time "interval" seconds pass. It's a code for a FNaF game.

 â„–4289645[Quote]

>>4289632
too many if statements, use more switch statements. the thingamabobs with
if r==0 Play (SND_METAL_01, 0);
im 30 percent sure you can make all of that into a swtich statement
idk what play means

 â„–4289658[Quote]

>>4289645
Play() means play a 3D sound coming from animatronic's position.

I know I could make them into switch statements. The problem is, it would not optimize anything at all, to compiler it would make no difference.
I chose to write if statements here instead of a swtich statement because

r = irandom(2)
if(r == 0) do dis
if(r == 1) do dis
if(r == 2) do dis

is more spatially compact than

switch(irandom(2)){
case 0: do dis
case 1: do dis
case 2: do dis
}

 â„–4289665[Quote]

>>4289658
the real problem is, I use camera indexes to differentiate them. It's not that bad, since they are numbered from 0-8 inside the game which I can remember pretty well, plus I use constants for floors, but it could be done better anyway. I could make a lookup by camera's name, but that would require looking up a string every frame for example, and also changing the name would have it's consequences. I could make lookup by backgrounds, but some cameras use the same backgrounds, so it's not a version either.

 â„–4289684[Quote]

>>4289645
what do (You) think?



[Return][Catalog][Go to top][Post a Reply]
Delete Post [ ]
[ home / overboard ] [ date ] [ soy / qa / raid / incel ] [ int / pol ] [ a / biz / fit / mtv / r9k / sude / tech / v / x ] [ q / news / chive / rules / pass / bans / status ] [ booru / wiki ]