• Create Account

We're offering banner ads on our site from just \$5!

### #Actualgareth_mcdaid

Posted 23 June 2013 - 02:27 PM

The sine wave generator is using a time, elapsed_time in milliseconds, or a time stamp milliseconds, to get the position of the sine wave.

The problem is I need to make the sine waves travel at any angle through 2D space, any help?

The sine wave generator is part of a separate projectile system, 10 is the maximum frequency, elapsed_time is required because this is to be used in a client and server game, where timing is crucial.

Create event

set=0;
frequency=1
amplitude=50*1.0
pixels[0,0]=0
pixel_num=0
xx=0

Draw event

if set=0
{
start_time=current_time
set=1
}

elapsed_time =current_time-start_time

{
}

xx=0

draw_set_color(c_red)
for(i=0;i<pixel_num;i+=1)
{

if i>0
{
}

}

{
pixel_num+=1
}


The projectiles move independent of the frame rate, using the elapsed time, the elapsed time is used to position the projectiles, it’s required to keep the server and client synchronized at all times.

Distance is calculated by using constants and the elapsed time, the constants are based of the server tick rate and the target fps, and there is a speed constant for each projectile used to calculate the number of pixels to move the projectile per millisecond of time passed

The below code as the desired effect but for only for four directions, I need 360 degrees of movement for this to be of use in my projectile

system..

angle=0

anlge=90

angle=180

angle=270


### #3gareth_mcdaid

Posted 23 June 2013 - 02:11 PM

The sine wave generator is using a time, elapsed_time in milliseconds, or a time stamp milliseconds, to get the position of the sine wave.

The problem is I need to make the sine waves travel at any angle through 2D space, any help?

The sine wave generator is part of a separate projectile system, 10 is the maximum frequency, elapsed_time is required because this is to be used in a client and server game, where timing is crucial.

Create event

set=0;
frequency=1
amplitude=50*1.0
pixels[0,0]=0
pixel_num=0
xx=0

Draw event

if set=0
{
start_time=current_time
set=1
}

elapsed_time =current_time-start_time

{
}

xx=0

draw_set_color(c_red)
for(i=0;i<pixel_num;i+=1)
{

if i>0
{
}

}

{
pixel_num+=1
}


The projectiles move independent of the frame rate, using the elapsed time, the elapsed time is used to position the projectiles, it’s required to keep the server and client synchronized at all times.

Distance is calculated by using constants and the elapsed time, the constants are based of the server tick rate and the target fps, and there is a speed constant for each projectile used to calculate the number of pixels to move the projectile per millisecond of time passed

The below code as the desired effect but for only four directions, I need 360 degrees of movement for this to be of use in my projectile

system..

angle=0

anlge=90

angle=180

angle=270


### #2gareth_mcdaid

Posted 23 June 2013 - 02:11 PM

The sine wave generator is using a time, elapsed_time in milliseconds, or a time stamp milliseconds, to get the position of the sine wave.

The problem is I need to make the sine waves travel at any angle through 2D space, any help?

The sine wave generator is part of a separate projectile system, 10 is the maximum frequency, elapsed_time is required because this is to be used in a client and server game, where timing is crucial.

Create event

set=0;
frequency=1
amplitude=50*1.0
pixels[0,0]=0
pixel_num=0
xx=0

Draw event

if set=0
{
start_time=current_time
set=1
}

elapsed_time =current_time-start_time

{
}

xx=0

draw_set_color(c_red)
for(i=0;i<pixel_num;i+=1)
{

if i>0
{
}

}

{
pixel_num+=1
}


The projectiles move independent of the frame rate, using the elapsed time, the elapsed time is used to position the projectiles, it’s required to keep the server and client synchronized at all times.

Distance is calculated by using constants and the elapsed time, the constants are based of the server tick rate and the target fps, and there is a speed constant for each projectile used to calculate the number of pixels to move the projectile per millisecond of time passed

The below code as the desired effect but for only four directions, I need 360 degrees of movement for this to be of use in my projectile

system..

angle=0

anlge=90

angle=180

angle=270


### #1gareth_mcdaid

Posted 23 June 2013 - 02:10 PM

The sine wave generator is using a time, elapsed_time in milliseconds, or a time stamp milliseconds, to get the position of the sine wave.

The problem is I need to make the sine waves travel at any angle through 2D space, any help?

The sine wave generator is part of a separate projectile system, 10 is the maximum frequency, elapsed_time is required because this is to be used in a client and server game, where timing is crucial.

Create event

set=0;
frequency=1
amplitude=50*1.0
pixels[0,0]=0
pixel_num=0
xx=0

Draw event

if set=0
{
start_time=current_time
set=1
}

elapsed_time =current_time-start_time

{
}

xx=0

draw_set_color(c_red)
for(i=0;i<pixel_num;i+=1)
{

if i>0
{
}

}

{
pixel_num+=1
}


The projectiles move independent of the frame rate, using the elapsed time, the elapsed time is used to position the projectiles, it’s required to keep the server and client synchronized at all times.

Distance is calculated by using constants and the elapsed time, the constants are based of the server tick rate and the target fps, and there is a speed constant for each projectile used to calculate the number of pixels to move the projectile per millisecond of time passed

The below code as the desired effect but for only four directions, I need 360 degrees of movement for this to be of use in my projectile

system..

angle=0

anlge=90

angle=180