![]() | 32 bits Impacto - Beta Release | ![]() |
Now, Impacto is 2 times faster and 4 times shorter than before, and have new built-in functions.
The files impacto.zip and examples.zip
contains the interpreter and examples texts files. Download the files to a
directory to your choice, and run the example programs with impacto.exe 'filename'.
The allegro.zip is the allegro help file. Allegro functions and Impacto
functions are more or less the same. You can use then to understand how to call impacto routines.
1. Open Notepad or another text editor, and type:
print("Hello Word")
save as hello.imp, for example.
end()
In the command line (or Start, Run in win95), type impacto hello.imp
and you see in your screen the words "Hello, Word" !
2. Now, type in notepad:
abc = 20
def = 40
x = abc + def
print("x is " x)
end()
Save and run, and you see "x is 60".
3. Now, type in notepad:
a = 20
d = 40
x = a + d
y = a * d
z = d / a
w = d - a
print("x is " x "\n")
print("y is " y "\n")
print("z is " z "\n")
print("w is " w )
end()
or type direct
print("x is " a+d "\n")
print("y is " a*d "\n")
print("z is " d/a "\n")
print("w is " d-a )
end()
Save and run, and you see
"x is 60"
"y is 800"
"z is 2"
"w is 20"
4. Now, graphics and sound:
graphics(19)
//you can assign sound files to variable
dead = loadwav("dead.wav")
//and music files
music=loadmidi("chase.mid")
//and play then
playwav(dead,255,255,1000,0)
//playmidi(music file, loop) (-1 means infinite)
playmidi(music, -1)
//now, put image on background
background=create_image(320,200)
//clear memory
clear_mem(background)
//now, draw a rectangle in memory
rectangle_mem(background, 10, 10, 310, 190, 50)
//you can draw horizontal and vertical lines, circles, etc
linhorz_mem(background, 10, 10, 50, 50)
//if you want draw in screen, use:
//you can write text direct to memory or screen
formatedtextout_mem("Score: %d",background,score, 20,0,20)
//now, waits for a vertical retrace to begin
vsync()
//and show image on the screen and clear backgorund
copy_image(background,-1,0,0,0,0,320,200)
//when you finish the game, return to text graphics mode
graphics(3)
//do not forget to write the end() command, or you will have trouble.
end()
//turn into mode 19 (decimal) or 13 (hex)
//install timer
//install keyboard handler
//install sound
timer()
keyboard()
sound()
life = loadwav("life.wav")
//playwav(sound file, volume (0-255), pan position(0-255) -> left, right, frequency, loop)
//first, create a memory area
//our memory is 'background', remeber ?
//retangulo_mem(where_to_draw, left, top, right, bottom, color) )
//in memory or direct to screen
//linhorz_mem(where-to-draw, left, top, right, color )
//linhorz(left, top, right, color )
clear_mem(background)
See examples.zip for more examples
This program is an beta release. I will not be held responsable for any damage caused by the use or mis-use of this program. You may distribute this program as long as it is in its original form and none of the accompanying files are altered and that it is provided free of charge, with the exception of transport costs, etc. *****YOU WILL USE THIS AT YOUR OWN RISK***** However I believe that it is stable enough for no problems to occurr.
Copyright ©1999, Mestre, Last update - 25/04/2002 13:27:00