raze-gles/polymer/eduke32/source/lunatic/test/animatesprites.con
helixhorned 85d6526264 Add some test CON files to source/lunatic/test.
The code is mostly by other people, who are credited in the CON files.

git-svn-id: https://svn.eduke32.com/eduke32@3627 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-29 15:59:26 +00:00

84 lines
2.1 KiB
Text

gamevar tmp 0 0
/*
actor LIZTROOP
getactor[THISACTOR].mdflags tmp
orvar tmp 16
setactor[THISACTOR].mdflags tmp
enda
*/
gamevar ceilz 0 0
gamevar ceilhit 0 0
gamevar florz 0 0
gamevar florhit 0 0
gamevar pi 0 0
define Q 500
gamevar pdist 0 2
onevent EVENT_GAME
ifactor LIZTROOP
findplayer pdist
endevent
onevent EVENT_ANIMATESPRITES
ifactor LIZTROOP
{
setvarvar tmp totalclock
andvar tmp 255
settspr[THISACTOR].tsprshade tmp
}
endevent
gamevar lizi 0 0
onevent EVENT_DISPLAYREST
findnearactor LIZTROOP 4096 lizi
ifvarn lizi -1
{
redefinequote Q nearest LIZTROOP is %d units away (Manhattan dist.)
qsprintf Q Q /**/ actorvar[lizi].pdist
gametextz STARTALPHANUM 10 100 Q 2 0 16 /*bounds:*/ 0 0 xdim ydim 32768
}
getplayer[THISACTOR].i pi
getzrange sprite[pi].x sprite[pi].y sprite[pi].z player[THISACTOR].cursectnum
/*out:*/ ceilz ceilhit florz florhit
/*in:*/ 128 CLIPMASK0
redefinequote Q hit %d at %d, %d at %d
qsprintf Q Q /**/ ceilhit ceilz florhit florz
minitext 100 8 Q 0 0
gametext STARTALPHANUM 320 16 Q 0 0 16 /*bounds:*/ 0 0 xdim ydim
gametextz STARTALPHANUM 320 24 Q 0 0 16 /*bounds:*/ 0 0 xdim ydim 32768
endevent
// Following code by Fox, from
// http://forums.duke4.net/topic/955-eduke32-scripting/page__view__findpost__p__153176
gamevar SIN 0 0
gamevar COS 0 0
gamevar HORIZ 0 0
gamevar HITSECT 0 0
gamevar HITWALL 0 0
gamevar HITSPRITE 0 0
gamevar HITX 0 0
gamevar HITY 0 0
gamevar HITZ 0 0
onevent EVENT_DISPLAYREST
sin SIN player[THISACTOR].ang
cos COS player[THISACTOR].ang
setvar HORIZ 100
subvarvar HORIZ player[THISACTOR].horiz
subvarvar HORIZ player[THISACTOR].horizoff
mulvar HORIZ 32
hitscan player[THISACTOR].posx player[THISACTOR].posy player[THISACTOR].posz player[THISACTOR].cursectnum
COS SIN HORIZ HITSECT HITWALL HITSPRITE HITX HITY HITZ CLIPMASK1
redefinequote Q hitscan: hit sector %d, wall %d, sprite %d
qsprintf Q Q /**/ HITSECT HITWALL HITSPRITE
minitext 100 80 Q 0 0
endevent