pixi dance 0.4

Pixilang programming language
Post Reply
User avatar
goglus
Posts: 122
Joined: Tue Dec 04, 2007 4:19 pm
Contact:

pixi dance 0.4

Post by goglus » Wed Dec 05, 2007 7:11 pm

h = get_hours
m = get_minutes
s = get_seconds
video_export_gif("$h.$m.$s.gif",-90,-100,181,181)
pause_video_export

//head coordinats
hx = -128
hy = 0
hz = 5 //ZOOM

head = "
11111111
19999991
19199191
19999991
19111191
19999991
11111111
"
make_pixi( head )
pixi_transp( head, 0 )

//left hand
x1=-20
y1=-30
ax1=-20
ay1=8

//right hand
x2=20
y2=-30
ax2=20
ay2=8

// left leg
x3=-10
y3=10
bx3=-28
by3=48

//right leg
x4=10
y4=10
bx4=28
by4=48

//head
x5=-1
y5=-50

start:

dd=0 //speed
clear(SNEG)

//buttons
box(-152,-82,40,10,BLACK)
print("save",-148,-81,BLACK)
box(-152,-70,40,10,BLACK)
print("stop",-148,-69,BLACK)

box(-90,-100,180,180,BLACK)
print("pixi_dance",-80,83, BLACK)

//head
pixi( head, x5,y5-12-get_pixi_ysize(head), 1, 0 )

//corpse
fbox (x5-2,y5-15,4,48,BLACK)

line (x1,y1,x5,y5-10,BLACK) //left hand
line (x2,y2,x5,y5-10,BLACK) //right hand

line (ax1,ay1,x1,y1,BLACK) //left hand2
line (ax2,ay2,x2,y2,BLACK) //right hand2


line (x3,y3,x5,y5+24,BLACK) //left leg
line (x4,y4,x5,y5+24,BLACK) //right leg

line (bx3,by3,x3,y3,BLACK) //left leg2
line (bx4,by4,x4,y4,BLACK) //right leg2

//left hand lokotok
box (x1,y1,4,4,RED)
//left hand
fbox (ax1,ay1,4,4,RED)

//right hand lokotok
box (x2,y2,4,4,RED)
//right hand
fbox (ax2,ay2,4,4,RED)

// left leg
box (x3,y3,4,4,RED)
fbox (bx3,by3,4,4,RED)
// right leg
box (x4,y4,4,4,RED)
fbox (bx4,by4,4,4,RED)

handle_keys({save drawe PEN_DOWN},{drawe PEN_MOVE},{ prev_x=-1 prev_y=-1})

PEN_DOWN = {
nomer=222
if get_pen_region(x1,y1,5,5) {nomer=1}
if get_pen_region(x2,y2,5,5) {nomer=2}
if get_pen_region(x3,y3,5,5) {nomer=3}
if get_pen_region(x4,y4,5,5) {nomer=4}
if get_pen_region(x5-2,y5-15,4,36) {nomer=5}
if get_pen_region(ax1,ay1,4,36) {nomer=6}
if get_pen_region(ax2,ay2,4,36) {nomer=7}
if get_pen_region(bx3,by3,4,36) {nomer=8}
if get_pen_region(bx4,by4,4,36) {nomer=9}
}

PEN_MOVE = {
if nomer=1 {x1=gpx y1=gpy}
if nomer=2 {x2=gpx y2=gpy}
if nomer=3 {x3=gpx y3=gpy}
if nomer=4 {x4=gpx y4=gpy}
if nomer=5 {
dx = gpx - x5 //GROWTH X
dy = gpy - y5 //GROWTH Y
x5=gpx y5=gpy
//GROWTH
x1 + dx y1 + dy
x2 + dx y2 + dy
x3 + dx y3 + dy
x4 + dx y4 + dy
bx4+ dx by4 + dy
bx3+ dx by3 + dy
ax1+ dx ay1+dy
ax2+ dx ay2+dy
}
if nomer=6 {ax1=gpx ay1=gpy}
if nomer=7 {ax2=gpx ay2=gpy}
if nomer=8 {bx3=gpx by3=gpy}
if nomer=9 {bx4=gpx by4=gpy}
}

//screen head
pixi( head, hx, hy, hz, 0 )
frame (dd)
pause_video_export
go start

save:
if gpr(-133,-82,40,10){
fbox(-152,-82,40,10,RED)
dd=270
resume_video_export //start video export
}
ret

drawe:
//draw head
x = gpx - ( hx - (get_pixi_xsize( head )*hz)/2 )
y = gpy - ( hy - (get_pixi_ysize( head )*hz)/2 )
x / hz
y / hz
x - get_pixi_xsize( head )/2
y - get_pixi_ysize( head )/2
set_screen( head )
if prev_x != x | prev_y != y { dot( x, y, get_dot( x, y ) ^ #FFFFFF ) }
prev_x = x
prev_y = y
set_screen( 0 )
ret

Post Reply