Xerol
Emperor
Usually programmers try to simplify things. To me, that means doing as much as possible in each line of code.
This sometimes results in super-long functions:
I tend to use custom font functions a lot too:
Doing a lot in one IF statement makes things a bit more efficient:
And I'm always pushing the right boundary of the IDE with calls like this:
So, do you have any hall-of-fame lines?
This sometimes results in super-long functions:
Code:
DECLARE SUB CreateTextObject(x as double, y as double, mx as double, my as double, ax as double, ay as double, c1 as integer, c2 as integer, text as string, font as integer, just as integer, age as double)
I tend to use custom font functions a lot too:
Code:
PrintFontGrad 400+player.mx*1.5, 32+player.my*1.5, gametitle$, 1, rgb(5+int(sin(frame)*5), 5-int(sin(frame*2)*5), 5+int(cos(frame*3)*5)), rgb(5-int(sin(frame)*5), 5+int(sin(frame*2)*5), 5-int(cos(frame*3)*5)), 0, 0
Code:
PrintFontGrad 400+player.mx*.5, 32+player.my*.5, gametitle$, 1, rgb(55+int(sin(frame)*50), 55-int(sin(frame*2)*50), 55+int(cos(frame*3)*50)), rgb(55-int(sin(frame)*50), 55+int(sin(frame*2)*50), 55-int(cos(frame*3)*50)), 0, 0
Code:
PrintFontGrad 400-player.mx*.5, 35-player.my*.5, gametitle$, 1, rgb(155+int(sin(frame)*100), 155-int(sin(frame*2)*100), 155+int(cos(frame*3)*100)), rgb(155-int(sin(frame)*100), 155+int(sin(frame*2)*100), 155-int(cos(frame*3)*100)), 0, 0
Code:
PrintFontGrad 400, 284, "- - - PAUSED - - -", 1, rgb((155+int(sin(frame)*100))*cmult, (155-int(sin(frame*2)*100))*cmult, (155+int(cos(frame*3)*100))*cmult), rgb((155-int(sin(frame)*100))*cmult, (155+int(sin(frame*2)*100))*cmult, (155-int(cos(frame*3)*100))*cmult), 0, 0
Doing a lot in one IF statement makes things a bit more efficient:
Code:
if aliens(n).hp < alientypes(aliens(n).alientype).maxhp + level^2*alientypes(aliens(n).alientype).hpbonus and aliens(n).hp > 0 then aliens(n).hp = aliens(n).hp + alientypes(aliens(n).alientype).regen * fpsrate
Code:
if abs(aliens(m).x+16-(projectiles(n).x+projectiletypes(projectiles(n).projectiletype).size/2)) < 16 and abs(aliens(m).y+16-(projectiles(n).y+projectiletypes(projectiles(n).projectiletype).size/2)) < 16 then
Code:
if batteries(n).charge > 0 then line (batteries(n).meterx1, batteries(n).metery1)-(batteries(n).meterx1 + batteries(n).meterwidth, batteries(n).metery1 - batteries(n).charge/batteries(n).maxcharge*batteries(n).meterheight), rgb(0, 255, 0), bf
And I'm always pushing the right boundary of the IDE with calls like this:
Code:
SpawnBullet (ship.x+cos(ship.dir+o*3.141592/180)*11, ship.y+sin(ship.dir+o*3.141592/180)*11, cos(ship.dir+(rnd-.5)/10 + o*3.141592/180)*(350+rnd*100-abs(o)), sin(ship.dir+(rnd-.5)/10 + o*3.141592/180)*(350+rnd*100-abs(o)), OWNER_PLAYER, 1, (30-abs(o))/30+1)
So, do you have any hall-of-fame lines?