Player related stuff, need help.

Hello.
So, I previusley said I know about dialogs and menus etc.
However, currently I know about player things, like positions and health and other integers, as well as speak and nvda menus.
So today, I decided that I would attempt to make a player related game. or test.
Now, i first saw the spelling and other things from the mason's open sourced stuff on his web. I made a half copyd, half my own code, but then i decided to remake it so I'd see if I at least remember something from the copying process. I Didn't actualy copy it from text to text, i just saw it's spelling.
anyway, enough of talking abough. I have a code where A player is in a map. What i want to know about is how to make it actualy jump, add items and walls, guns doors. as well, as an enemy script with a way to impliment the enemy script into the test project easily, like nathantech's menu.
I'm not expecting people to sit for a few hours writing a code for me. Anyway, I did try to make the gun system, and it workes, I think anyway. . Still, a small weapon system would be very appreciated. I did try to make the jumping system, but it just doesn't go up and down, all it does is play the up sound and the land sound immediately together. I tried making the walls as well, but I couldn't, so i just made it return to main menu. here's the code.
#include "sound_pool.bgt"
#include "menu.bgt"
timer wtimer;
int wspeed=200;
int jump=1000;
int player_x=0;
int player_y=0;
sound_pool spool(20);
timer jumpingtimer;
int health=1000;
void main()
{
int r;
show_game_window("blackredwhitegreentestofdume");
string text="testing0.";
string[] items={"Start","end."};
r=new_menu(text, items, 0);
if(r==1)
{
game();
}
if(r==2)
{
exit();
}
}
void game()
{
spool.play_stationary("sounds/amb.wav", true);
while(true)
{
if(key_pressed(KEY_ESCAPE))
{
exit();
}
if(key_down(KEY_RIGHT) and wtimer.elapsed>=wspeed)
{

spool.play_stationary("sounds/step"+random(1,3)+".ogg", false, false);
player_x+=1;
spool.update_listener_1d(player_x);
wtimer.restart();
}
if(key_down(KEY_LEFT) and wtimer.elapsed>=wspeed)
{
player_x-=1;
spool.play_stationary("sounds/step"+random(1,3)+".ogg", false, false);
spool.update_listener_1d(player_x);
wtimer.restart();
}
if(key_pressed(KEY_UP) and jumpingtimer.elapsed>=jump)
{
spool.play_stationary("sounds/jump.wav", false, false);
player_y+=5;
spool.update_listener_1d(player_y);
jumpingtimer.restart();
player_y-=5;
spool.play_stationary("sounds/land.ogg", false, false);
}
if(key_pressed(KEY_H))
{
speak_wait("your health is, "+health+".");
}
if (key_pressed(KEY_C))
{
speak_wait(""+player_x+", "+player_y+". ");
}
if(key_down(KEY_LEFT) and player_x==0)
{
spool.destroy_all();
main();
}
if(key_down(KEY_RIGHT) and player_x==35)
{
spool.destroy_all();
main();
}
}
}
bye.

-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Ahng via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ahng via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ahng via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : audiogame via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ahng via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : redfox via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ahng via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : redfox via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ahng via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : redfox via Audiogames-reflector

Reply via email to