Computer Science Canada

How do you make a heart move across the screen?

Author:  lisa89 [ Mon Jun 14, 2004 1:28 pm ]
Post subject:  How do you make a heart move across the screen?

I'm making a program for school and at the end i need a heart to move across the screen from left to right.. if you can help me that would great!!

Author:  AsianSensation [ Mon Jun 14, 2004 1:45 pm ]
Post subject: 

you can import a picture, and when you are drawing it, do something like this:

code:
var picID := Pic.FileNew ("heart.bmp")
var x, y := 0

loop
    x += 5
    Pic.Draw (picID, x, y, picMerge)
    cls
end loop



of course, you need a picture called heart.bmp in the same folder as the code.

Author:  greenapplesodaex [ Mon Jun 14, 2004 2:05 pm ]
Post subject:  reply

yeah, what he said...
or you can use sprite... i dont know, the new turing added some new graphical functions, i havent look at them yet, maybe you dont need sprite at all

Author:  DanShadow [ Mon Jul 26, 2004 6:56 pm ]
Post subject: 

I got bored, this code is like an update of AS.
code:

var heartPic:int:=Pic.FileNew("heart.bmp")
var x,y:=0
y:=round(maxy/2)
loop
setscreen("offscreenonly")
View.Update
cls
x+=5
Pic.Draw(heartPic,x,y,picMerge)
if x>maxx then
x:=0
end if
end loop

lol...I need a life outside work and compsci.


: