Pages:
1
2 |
MikeDX
|
|
Basically using draw primitives would use a lot more code
|
|
BreadCaster
Loyalty Card Holder
Posts: 321
Registered: 2-3-2016
Member Is Offline
|
|
ah, and the size of the lines of code would be more than the size of the .fpg? or does the .fpg not count :p
~*~ Princess of Pies and Pastries ~*~
|
|
MikeDX
|
|
The fpg doesnt count. just the bytes of code
|
|
Dennis
Loyalty Card Holder
Posts: 84
Registered: 26-2-2016
Location: Belgium
Member Is Offline
|
|
Score: 172 (Confirmed by Mike)
Impressive code hacks here. Technically I am stuck making it shorter so I FOUND A LOOPHOLE in the game rules!
Code: |
program a;
begin
load_fpg("f");
p(1,1,99); // 180 can be 99
end
process p(t,x,y)
begin
graph=t*t; // smaller way of abs
repeat
if(t)
x=mouse.x;
p(-8,x,y-9); // OMG a ship with an AUTO TURRET! XD
p(6,timer%99,0); // Don't like this, one, but as per rules, rocks don't NEED to be spread out when falling
end
y+=t-1; // shaved off the else
frame;
until(collision(type p)|y>240|y<0)
end
|
|
|
MikeDX
|
|
Nicely done Dennis
|
|
MikeDX
|
|
Score: 163 (but no real game)
New winner: (not really).
Code: |
program a;
begin
load_fpg("f");
p(1,1,99); // 180 can be 99
end
process p(t,x,y)
begin
graph=t*t; // smaller way of abs
repeat
if(t)
x=mouse; // x is the first element of mouse, no need for .x ;)
p(-8,x,y-9); // OMG a ship with an AUTO TURRET! XD
p(6,x,0); // nothing in rules saying where rocks start
end
y+=t-1; // shaved off the else
frame;
until(collision(type p)|y>240|y<0)
end
|
Attachment: bla.zip (2kB) This file has been downloaded 6214 times
|
|
Sandman
Loyalty Card Holder
Posts: 56
Registered: 26-2-2016
Member Is Offline
|
|
I actually had a constant for the x at some point, but I changed that to the timer, because it won't work since rocks will spawn over themselves and
get destroyed immediately. In your case, only if you move your mouse fast enough will they actually fall down. I don't think this qualifies as a
falling rocks game!
EDIT: though using x is a much better idea than a constant
|
|
Sandman
Loyalty Card Holder
Posts: 56
Registered: 26-2-2016
Member Is Offline
|
|
Score: 160 (but no real game)
But!
Code: |
program a;
begin
load_fpg("f");
p(1,1,98); // 180 can be 99
end
process p(t,x,y)
begin
graph=t*t; // smaller way of abs
while(!collision(type p)&y<99&y>0)
if(t)
x=mouse; // x is the first element of mouse, no need for .x ;)
p(-8,x,y-9); // OMG a ship with an AUTO TURRET! XD
p(6,x,1); // nothing in rules saying where rocks start
end
y+=t-1; // shaved off the else
frame;
end
end
|
Attachment: bla.zip (2kB) This file has been downloaded 6203 times
|
|
MikeDX
|
|
Score: 170
Agreed. I'll have to go for this instead
Code: |
program a;
begin
load_fpg("f");
p(1,1,99); // 180 can be 99
end
process p(t,x,y)
begin
graph=t*t; // smaller way of abs
repeat
if(t)
x=mouse; // x is the first element of mouse, no need for .x ;)
p(-8,x,y-9); // OMG a ship with an AUTO TURRET! XD
p(6,timer%99,0); // Don't like this, one, but as per rules, rocks don't NEED to be spread out when falling
end
y+=t-1; // shaved off the else
frame;
until(collision(type p)|y>240|y<0)
end
|
Attachment: bla.zip (2kB) This file has been downloaded 6220 times
|
|
MikeDX
|
|
Your 160 is nice. But I reckon I can keep 160 and make more of a game out of it
|
|
Sandman
Loyalty Card Holder
Posts: 56
Registered: 26-2-2016
Member Is Offline
|
|
I'll add the one without x for me as well for completeness:
Code: |
program a;
begin
load_fpg("f");
p(1,1,98); // 180 can be 99
end
process p(t,x,y)
begin
graph=t*t; // smaller way of abs
while(!collision(type p)&y<99&y>0)
if(t)
x=mouse; // x is the first element of mouse, no need for .x ;)
p(-8,x,y-9); // OMG a ship with an AUTO TURRET! XD
p(6,timer%99,1); // nothing in rules saying where rocks start
end
y+=t-1; // shaved off the else
frame;
end
end
|
|
|
MikeDX
|
|
Score: 158
Utter filth, 158 chars, AND a playable game
Code: |
program a;
begin
load_fpg("f");
p(1,1,98); // 180 can be 99
end
process p(t,x,y)
begin
graph=t*t; // smaller way of abs
while(!collision(type p)&y<99&y>0)
if(t)
x=mouse; // x is the first element of mouse, no need for .x ;)
p(-6,x,y); // OMG a ship with an AUTO TURRET! XD
p(8,x,1); // nothing in rules saying where rocks start
end
y+=t-1; // shaved off the else
frame;
end
end
|
Attachment: bla.zip (2kB) This file has been downloaded 6255 times
|
|
Sandman
Loyalty Card Holder
Posts: 56
Registered: 26-2-2016
Member Is Offline
|
|
Good offset use!
I also made improvements:
Code: |
program a;
begin
load_fpg("f");
p(0,1,97); // 180 can be 99
end
process p(t,x,y)
begin
graph=t+9; // smaller way of abs
while(!collision(type p)&y%99) //y<99&y>0)
if(t==0)
x=mouse; // x is the first element of mouse, no need for .x ;)
//p(-8,x,y-8); // OMG a ship with an AUTO TURRET! XD
p(6,p(-8,x,y-8)%y,1); // nothing in rules saying where rocks start
end
y+=t; // shaved off the else
frame;
end
end
|
157 chars
Attachment: rocks157.zip (2kB) This file has been downloaded 6503 times
|
|
MikeDX
|
|
using the returned id of p() with %y is a genius faux random. very nicely done indeed!
|
|
Sandman
Loyalty Card Holder
Posts: 56
Registered: 26-2-2016
Member Is Offline
|
|
The y-check is even more devious: all objects start at an odd y value, meaning y&99 is true, but when they reach >99 or <-99, y%99 becomes
an even number.
|
|
Sandman
Loyalty Card Holder
Posts: 56
Registered: 26-2-2016
Member Is Offline
|
|
Score: 153 (Confirmed by Mike)
OK, the final one:
Code: |
program a;
begin
load_fpg("f");
p(9,1,97); // 180 can be 99
end
process p(t,x,y)
begin
graph=t+9; // smaller way of abs
while(collision(type p)^y%99) //y<99&y>0)
if(t)
x=mouse; // x is the first element of mouse, no need for .x ;)
//p(-8,x,y-8); // OMG a ship with an AUTO TURRET! XD
p(6,p(-8,x,y)%y,1); // nothing in rules saying where rocks start
end
y+=t%9; // shaved off the else
frame;
end
end
|
153 chars
Attachment: rocks153.zip (2kB) This file has been downloaded 6260 times
|
|
MikeDX
|
|
I think we may have a winner. Very very nicely done. and a good group effort
|
|
Dennis
Loyalty Card Holder
Posts: 84
Registered: 26-2-2016
Location: Belgium
Member Is Offline
|
|
Kudos Sandman! Wow, I never thought the code would get this short! I already gave up under 172 chars.
I think I deserve some credit for some of the awesome graphics though.
|
|
MikeDX
|
|
Dennis this is definitely a group effort. Some awesome tricks in there.
|
|
Sandman
Loyalty Card Holder
Posts: 56
Registered: 26-2-2016
Member Is Offline
|
|
Dennis, of course! Your initial idea of using only a single process type did the most, in fact.
|
|
Dennis
Loyalty Card Holder
Posts: 84
Registered: 26-2-2016
Location: Belgium
Member Is Offline
|
|
Why thank you! I was just kidding about the credit though.
|
|
iWizard
Loyalty Card Holder
Posts: 159
Registered: 26-2-2016
Member Is Offline
|
|
You forgot to copyright it to hell and back DDD:
|
|
Dennis
Loyalty Card Holder
Posts: 84
Registered: 26-2-2016
Location: Belgium
Member Is Offline
|
|
Copyright it, put micro trandsactions in it, put it on Google Play Story aaaand good to go by the norm!!!1!1
|
|
Sandman
Loyalty Card Holder
Posts: 56
Registered: 26-2-2016
Member Is Offline
|
|
Get it to <150, Dennis, you can do it! Or maybe we need a new code golf challenge.
|
|
Pages:
1
2 |