include "global/view.t" % loads needed information
% ---------------------------------------------------------
% character class (motion, draw, shooting)
% main class for game
class char_
export draw
var c_x, c_y : int := 0
var c_state : string (1)
var walkright_frames : array 1 .. 5 of int
var ani_num : int := 1
procedure load_images
% loads walkright_frames (walking - right direction)
walkright_frames (1) := Pic.FileNew ("animations/vasava/walkright_1.bmp")
Pic.SetTransparentColor (walkright_frames (1), white)
walkright_frames (2) := Pic.FileNew ("animations/vasava/walkright_2.bmp")
Pic.SetTransparentColor (walkright_frames (2), white)
walkright_frames (3) := Pic.FileNew ("animations/vasava/walkright_3.bmp")
Pic.SetTransparentColor (walkright_frames (3), white)
walkright_frames (4) := Pic.FileNew ("animations/vasava/walkright_4.bmp")
Pic.SetTransparentColor (walkright_frames (4), white)
walkright_frames (5) := Pic.FileNew ("animations/vasava/walkright_4.bmp")
Pic.SetTransparentColor (walkright_frames (5), white)
end load_images
procedure draw
load_images
% draws character
Pic.Draw (walkright_frames (ani_num), c_x, c_y, picCopy)
end draw
end char_
var CHAR : pointer to char_
new char_, CHAR
class bg
export draw
procedure draw
Pic.ScreenLoad ("1.bmp", 0, 0, picMerge)
end draw
end bg
var BG : pointer to bg
new bg, BG
loop
BG -> draw
CHAR -> draw
end loop
|