Code: Select all
//pixilang (2009)
X=-90
body = new_pixi( 5, 7, 1 )
head = new_pixi( 7, 7, 1 )
hand = new_pixi( 9, 3, 1 )
foot = new_pixi( 11,5, 1 )
clear( )
//pole
fbox(-80,-120,160,250,SNEG)
print("clik - generate robot",-85,-132,SNEG)
start:
fbox(X+2,-153,40,15,RED)
fbox(X,-155,40,15,#dfdfff)
print("Head",X+3,-150,BLACK)
fbox(X+47,-153,40,15,RED)
fbox(X+45,-155,40,15,#dfdfff)
print("Body",X+50,-150,BLACK)
fbox(X+92,-153,40,15,RED)
fbox(X+90,-155,40,15,#dfdfff)
print("Hand",X+93,-150,BLACK)
fbox(X+137,-153,40,15,RED)
fbox(X+135,-155,40,15,#dfdfff)
print("Foot",X+138,-150,BLACK)
fbox(X+12,137,40,15,RED)
fbox(X+10,135,40,15,#dfdfff)
print("Save",X+13,140,BLACK)
fbox(X+132,137,40,15,RED)
fbox(X+130,135,40,15,#dfdfff)
print("Mix",X+133,140,BLACK)
//robots
pixi(head, 0, -70, 8 )
pixi( foot, 0, 80, 12 )
fbox(-30,30,60,80,SNEG)
pixi( hand, 0, 0, 16 )
pixi( body, 0, 20, 16 )
handle_keys(
{
if gpr(X+45,-155,40,15) {Body}
if gpr(X+90,-155,40,15){Hand}
if gpr(X+135,-155,40,15){Foot}
if gpr(X,-155,40,15){Head}
if gpr(X+10,135,40,15){save}
if gpr(X+130,135,40,15){Head Foot Hand Body}
}
,{pause_video_export}, { } )
frame(0)
go start
Body:
set_screen( body )
xs = get_pixi_xsize( body )
ys = get_pixi_ysize( body )
y = 0 x = 0
yloop:
x = 0
xloop:
xx = x - xs / 2
yy = y - ys / 2
dot( xx, yy, #FFFFFF )
dot( -xx, yy, #FFFFFF )
dot( -xx, -yy, #FFFFFF )
dot( xx, -yy, #FFFFFF )
if rand & 1 {
dot( xx, yy, #101010 )
dot( -xx, yy, #101010 )
dot( -xx, -yy, #101010 )
dot( xx, -yy, #101010 )
}
x + 1
if x < xs { go xloop }
y + 1
if y < ys { go yloop }
set_screen( 0 )
ret
Head:
set_screen( head )
hxs = get_pixi_xsize( head )
hys = get_pixi_ysize( head)
hy = 0 hx = 0
hyloop:
hx = 0
hxloop:
hxx = hx - hxs/2
hyy = hy - hxs/2
dot( hx, hy, #FFFFFF )
dot( -hx, hy, #FFFFFF )
if rand & 1{
dot( hxx, hyy, #101010 )
dot( -hxx, hyy, #101010 )}
hx + 1
if hx < hxs { go hxloop }
hy + 1
if hy < hys { go hyloop }
set_screen( 0 )
ret
Hand:
set_screen( hand )
handxs = get_pixi_xsize( hand )
handys = get_pixi_ysize( hand )
handy = 0 handx = 0
handyloop:
handx = 0
handxloop:
handxx = handx - handxs / 2
handyy = handy - handys / 2
dot( handxx, handyy, #FFFFFF )
dot( -handxx, handyy, #FFFFFF )
dot( -handxx, -handyy, #FFFFFF )
dot( handxx, -handyy, #FFFFFF )
if rand & 1 {
dot( handxx, handyy, #101010 )
dot( -handxx, handyy, #101010 )
dot( -handxx, -handyy, #101010 )
dot( handxx, -handyy, #101010 )
}
handx + 1
if handx < handxs { go handxloop }
handy + 1
if handy < handys { go handyloop }
set_screen( 0 )
ret
Foot:
set_screen( foot )
footxs = get_pixi_xsize( foot )
footys = get_pixi_ysize( foot )
footy = 0 footx = 0
footyloop:
footx = 0
footxloop:
footxx = footx - footxs / 2
footyy = footy - footys / 2
dot( footxx, footyy, #FFFFFF )
dot( -footxx, footyy, #FFFFFF )
dot( -footxx, -footyy, #FFFFFF )
dot( footxx, -footyy, #FFFFFF )
if rand & 1 {
dot( footxx, footyy, #101010 )
dot( -footxx, footyy, #101010 )
dot( -footxx, -footyy, #101010 )
dot( footxx, -footyy, #101010 )
}
footx + 1
if footx < footxs { go footxloop }
footy + 1
if footy < footys { go footyloop }
set_screen( 0 )
ret
save:
h = get_hours
m = get_minutes
s = get_seconds
if gpr(-100,135,40,15){
video_export_gif("robot.$h.$m.$s.gif",-80,-120,160,250)}
ret