2 registered members (AndrewAMD, 1 invisible),
1,395
guests, and 12
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Fighting Game
[Re: lostclimate]
#244125
01/02/09 19:58
01/02/09 19:58
|
Joined: Jan 2009
Posts: 6
Comatose
OP
Newbie
|
OP
Newbie
Joined: Jan 2009
Posts: 6
|
Thanks, I found the c_move command in the workshop but it seems to only deal with 3D environments. Since I just want 2D movement what do I do?
I can get the object I want to move onto the level but when I do anything with the c_move commands it doesn't work right at all. I tried just copying the code from the workshop example (the ball game) and replacing the ball with what I wanted to move and it worked a little, however it just caused my object to go off the level and get stuck.
When I tried to tweak it to not move like a ball (because the image I was moving was rotating like the ball in the example) it didn't move at all.
I just want the bloody thing to move left, right and jump when I press certain keys, is it really this difficult or am I missing something very simple?
EDIT: Ok, I figured this out. Now I want to add a sound when I press a key combination. For example, I want to press the buttons for down, back, and let's say 'a' and I want it to play a sound. I found threads and looked in the templates to find how to do this but it's not working for me. I even set it so that it would only take one button press just to see if I could get it to work in an incredibly simple way.
This is how I have it declared: SOUND wakeupfever = "wakeupfever.wav"; <--everything I've seen has the file declared like this: SOUND wakeupfever = <wakeupfever.wav>; but the program won't compile if i do this.
I have the function called like this: function wakeupfever();{
if((key_cud == 1)) { wait(60); ent_playsound(my,wakeupfever,200); } } Keep in mind that I got this information from the template and looking on the forum and everything was for a 3D game, is it different for 2D?
Thanks for all the help.
Last edited by Comatose; 01/02/09 22:09.
|
|
|
Re: Fighting Game
[Re: Comatose]
#244154
01/02/09 23:15
01/02/09 23:15
|
Fear411
Unregistered
|
Fear411
Unregistered
|
the name of the sound and the name of the function have not to be the same
SOUND wakeupfever_snd = "wakeupfever.wav";
function wakeupfever(); { if((key_cud == 1)) { wait(60); ent_playsound(my,wakeupfever_snd,200); } }
|
|
|
|