Animating with a static background
Author |
Message |
krazykipa
|
Posted: Tue Dec 16, 2008 5:12 pm Post subject: Animating with a static background |
|
|
Hi there everyone,
Just wondering, for this game I'm making there's an animation of a helicopter which must move against a still background.
The way I have it so far is that the background must be drawn each time through the loop due to the Draw.Cls
It works fine at home, but since my school's computers are crap, the ~1Mb background picture lags them up like... well, you get the point...
Anyways, I was just wondering if I could set the background to be static and unperturbed by the Draw.Cls so as to reduce lag and allow me to pass CompSci
Thanks!
Oh, here's some code:
code: |
loop
Draw.Cls
Pic.Draw (background, 1, 1, picMerge)
Pic.Draw (copter, x, y, picMerge)
Pic.Draw (wall, wallX, wallY, picMerge)
%A procedure to update coordinates of chopper+wall
updatePos
View.Update
%Crash Detection
if y >= 490 or y <= 50 then
exit
elsif x2 > wallX and x < wallX2 and y2 > wallY and y < wallY2 then
exit
end if
end loop
|
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
andrew.
|
Posted: Wed Dec 17, 2008 6:04 pm Post subject: RE:Animating with a static background |
|
|
Look up using sprites. Basically, you make your helicopter a sprite and when you change the x and y values, the picture is automatically redrawn without using cls. |
|
|
|
|
|
|
|