Here is the code. I apologized for maybe its too long. Is there a way to attach a file?
=============================================================================
path "C:\\HWorld\\templates"; // Path to WDL templates subdirectory
path "C:\\HWorld\\models";
path "C:\\HWorld\\textures";
path "C:\\HWorld\\sounds";
var gold = 0; // The Gold
var amtpickup;
string gold_str = "GOLD = ";
include <warlock.wdl>;
//include <player.wdl>;
include <lines.wdl>;
//include <move.wdl>;
include <movement.wdl>;
include <cameras.wdl>;
include <messages.wdl>;
include <menu.wdl>; // must be inserted before doors and weapons
include <particle.wdl>; // remove when you need no particles
include <doors.wdl>; // remove when you need no doors
include <actors.wdl>; // remove when you need no actors
include <weapons.wdl>; // remove when you need no weapons
include <war.wdl>; // remove when you need no fighting
//include <venture.wdl>; // include when doing an adventure
//include <lflare.wdl>; // remove when you need no lens flares
////////////////////////////////////////////////////////////////////////////
// The engine starts in the resolution given by the follwing vars.
var video_mode = 7; // screen size 800x600
var video_depth = 32; // 32 bit colour D3D mode
//var video_screen = 1; // full screen
string level_str = <HWorld.WMB>; // give file names in angular brackets
///////////Define Font///////////
font arial_font = "Arial",0,16; // true type, Arial, non-bold, size = 20
///////////Define Sounds///////
//Sound ploing = <ploing.wav>; //The Coin impact Sound
/////////Define Bmaps///////////
bmap dash_bmap = <dash.bmp>;
bmap letters_bmap = <letters.bmp>;
bmap inventory_bmap = <inventory.bmp>;
bmap quitgame_bmap = <quitgame.bmp>;
bmap cursor_pcx = <cursor.pcx>;
//bmap letters_menu_bmap = <letters_menu.bmp>;
//bmap inv_menu_bmap = <inv_menu.bmp>;
function main()
{
load_level(<HWorld.wmb>);
set_cameras();
mouse_map = cursor_pcx;
mouse_mode = 1;
while (1)
{
total_gold_collect();
player_movement();
mouse_pos.x = pointer.x;
mouse_pos.y = pointer.y;
wait (1);
}
}
on_esc = quit_game();
function total_gold_collect()
{
if (gold >= 19)
{
exit;
}
}
function player_movement()
{
key_force.x = key_d - key_a;
key_force.y = key_w - key_s;
}
function more_gold()
{
amtpickup = random(4)+1;
//play_sound ploing,60; // Play a sound...
gold += amtpickup; // ..give me random points...
remove(me); //... and remove me
}
function inventory_clicked()
{
exit;
}
function letters_clicked()
{
exit;
}
function quit_game()
{
//sleep(3);
exit;
}
panel inventory_button
{
bmap = inventory_bmap;
pos_x = 12;
pos_y = 522;
button = 0,0,inventory_bmap,inventory_bmap,inventory_bmap,inventory_clicked,null,null;
flags = ,,refresh,visible;
}
panel letters_button
{
bmap = letters_bmap;
pos_x = 52;
pos_y = 522;
button = 0,0,letters_bmap,letters_bmap,letters_bmap,letters_clicked,null,null;
flags = ,,refresh,visible;
}
panel quitgame_button
{
bmap = quitgame_bmap;
pos_x = 712;
pos_y = 522;
button = 0,0,quitgame_bmap,quitgame_bmap,quitgame_bmap,quit_game,null,null;
flags = ,,refresh,visible;
}
panel gold_panel // print gold amount
{
pos_x = 56;
pos_y = 565;
flags = visible,refresh;
digits 0,0,3,arial_font,1,gold;
}
text gold_txt // print "GOLD" text
{
pos_x = 12;
pos_y = 565;
font = arial_font;
string = gold_str;
flags = visible;
}
action coin // the coin action
{
my.enable_impact = on; // On impact....
my.event = more_gold; // ...my.event more_gold..
}
panel dash_panel
{
bmap = dash_bmap;
pos_x = 0;
pos_y = 510;
flags = visible;
}
==========================================================
Thank you.
Tri
Last edited by trister; 05/12/06 13:06.