
-----------------------------------
The_Bean
Sat Dec 08, 2007 12:32 am

Shadow Comeing off a word
-----------------------------------
Casts a Shdaow off of a word and the sun is your mouse so the shadow comes off opposite to your mouse.

Uses math and trig.

1 or 2 glitches that i know of because of tan=y/x  so 90 degrees causes an error so i had to bypass that which causes a small glitch and for a similar reason theres another at 180. Im working on fixing them but no succes yet.  And i didn't comment it.

The original one that i made of this was for my class mates.  Without having them do anything it new what there name was (which was kind of creepy) and put it in the middle of the screen, but it only works at scool computers so i had to remove that feature for this version.


 
setscreen("graphics:max,max")

var name :string
put "Please enter your name or a word or something: "..
get name
setscreen("offscreenonly")
var xm,ym,bm :int
var sx,sy,sr :int
var degree :real:=0
var font:int := Font.New ("serif:40")

loop
Mouse.Where(xm,ym,bm)
xm:= xm-maxx div 2
ym:=ym -maxy div 2
if xm not =0 then
degree:= arctand(abs(ym)/abs(xm))
end if
if xm = 0 then
degree:=90
end if
sr:=round(sqrt(xm**2+ym**2))div 2
if xm>0 and ym>=0 then 
degree+=0
end if
if xm0 then 
degree:=180-degree
end if
if xm