Page 1 of 1

Playing a sound help

PostPosted: Tue May 31, 2011 7:34 pm
by PreludeDikter
Hi, i'm new to these forums. I was having trouble trying to figure out how to get a "Event" to shoot towards another event, like a bullet towards a sight.

I'd like the "sight" to follow the mouse, the bullet starts at the player, and when clicked, fires at the sight, GOES PAST IT, and off screen, or collide with so an so, or what ever.

I've managed to get the bullet to start at the player, and fire in specified directions, but i'm having trouble finding the sight's x and y, so the bullet will fire at it, and not stop where ever the sight was at that given time, and then hang there doing nothing.

Sorry if the explanation sucks.

Re: Bullet direction help

PostPosted: Tue May 31, 2011 7:49 pm
by schnellboot
you need directional_velocity and angle
here are the script references
angle: Move the Actor's angle (0 to 360, from the positive x axis, counterclockwise, in degrees).

directional_velocity: The Actor's velocity in pixels / frame, in angle direction (set this Actor variable only when it is used with angle)


to set the angle to your mouse you can use this code
Code: Select all
angle = direction(xscreen, yscreen, xmouse, ymouse);


if you need any more help just ask me

Re: Bullet direction help

PostPosted: Tue May 31, 2011 10:53 pm
by PreludeDikter
Would you be able to upload a small demo? I'm able to understand coding so much easier when i see it in the editor.
I'm not sure what you mean by your post.

Re: Bullet direction help

PostPosted: Tue May 31, 2011 11:09 pm
by skydereign
Here is an example using the code schnellboot provided. The code goes into the Create Actor event of the bullet.

Re: Bullet direction help

PostPosted: Thu Jun 02, 2011 3:13 am
by PreludeDikter
Thanks alot, that's exactly what i needed. Sorry if i sounded like a jerk... :?

I have another problem i'd like to present to you guys, I've been having trouble playing sounds and music. It keeps saying,
"File is not supported, please change to PCM encoded .WAV file"...

first i don't know what it means, and when i downloaded another game from this site, it started working (for all the games, i could upload music and sounds to previous games, and they all did what they were supposed too.), but after awhile it started up again, so anything that was already uploaded wouldn't play in-game, and it brought up that error message when i tried to re upload.


I'm also using ubuntu(linux) if that has anything to do with it.

any ideas? :|

Re: Playing a sound help

PostPosted: Thu Jun 02, 2011 6:54 am
by skydereign
I encountered this before (back when sound was by default working for Linux). The problem it is having I don't believe are actually related to the pcm encoding, as I tried to re-encode it in audacity, but it still didn't work. Fedora stopped supporting legacy sound, so I stopped running into the problem. So, not really sure if there is a fix, if anyone else has experienced this do tell. Just for experimenting, can you upload one of the files that would give the error? Also, are you using the gameEditorLinuxAlsa file provided on the game-editor.net site? Or does Ubuntu still support oss?

Re: Playing a sound help

PostPosted: Thu Jun 02, 2011 8:33 pm
by PreludeDikter
And now it's working again. It doesn't matter what file it was working or not working on, because it would either work on all of them, or not work on all of them. I guess all i can do is finish my game, and wait till when it's working to export it. XD