is there a better way to do this? (bgt)

hay there.

well, erm,
so, I tried making a small rpg for my amusement. but, I wonder, is there a  better way to do this?
I will pased  the code below.
///rpg test
///lets include the things we will be needing
#include"sound_pool.bgt"
#include"m_pro.bgt"
#include"dlg.bgt"
///now, let's set up some values
int level=1;///the level of the player
int defence=6;///the defence of the player
int speed=6;///the speed of the player
int attack=6;///the strength of the player
int mana=20;///the players mana
int health=50;///the players health
int exp=20;///the players exp
int walkingspeed=200;///how fast the player moves
int expn=random(10,50);///the amount the player will need to level, I don't know a better way of doing this.
bool battle=false;///if this is set to true, the battle will start
int gold=2500;///the amount of gold the player has
int x,y;///the players x and y things
int player_position;///I really don't know why this is here
timer walk_timer;///the walk timer
bool jumping=false;///I don't know if I want jumping or Not. if it is true, the player jumps
///lets now do some stuff about sounds
sound_pool p;
sound walk;
sound warp;
sound notice;
void main()///the main funktion of the game
{
walk.load("sounds/walk.wav");
warp.load("sounds/warp.ogg");
notice.load("sounds/notice.ogg");
show_game_window("earth. the new begining");
game();
}
void game()
{
while(true)
{
///now let's set up some game shortcuts
if (key_pressed(KEY_H))
{
speak(health+" health");
}
if (key_pressed(KEY_L))
{
speak("level"+level);
}
///now, I tried so when you press shift and L, it tells you how mutch exp you have, the players level, and the exp you need to reach the next level
if((key_down(KEY_LSHIFT))&&(key_pressed(KEY_L)))
{
speak("your on level"+level +"and you need "+expn +"experionse points to reach to the next level");
}
if (key_pressed(KEY_G))
{
speak(gold+" gold");
}
if (key_pressed(KEY_C))
{
speak("location:"+x+","+y);
}
///now, I know this is wrong, this is why I asked for help
if (key_down(KEY_RIGHT))
{
x+=1;
walk_timer.restart();
p.play_stationary("sounds/footstep"+random(1,3)+".ogg",false);
}
if (key_down(KEY_LEFT))
{
x-=1;
walk_timer.restart();
p.play_stationary("sounds/footstep"+random(1,3)+".ogg",false);
}
///this is a thing I setup just because I wanted to see if it would work.
if ((x==300))
{
notice.play();
dlg("wait a minute! I can't let you pass just now");
convo();
}
if (key_pressed(KEY_Q))
{
exit();
}
}
}
void convo()
{
walk.play();
wait(3000);
dlg("sorry, but there is a sinkhole over there, it is to dangerus to pass, i'm afrade.");
wait(600);
dlg("but, using my magic I can warp you past it, no sweat!");
warp.play();
x=400;
}
thanks.

-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Gaki_shonen via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : bgt lover via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Gaki_shonen via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : bgt lover via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Gaki_shonen via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Gaki_shonen via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : JayJay via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Gaki_shonen via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : pool via Audiogames-reflector

Reply via email to