shooting in 2d

Blitz3D Forums/Blitz3D Beginners Area/shooting in 2d

in my (old) project i using bresenham for my shoot algo
i stored the x,y pixelcoord. from the bresenham algo in a array
and draw then later,pixel by pixel because i need a shoot not a line
but this way is so nooby imho

any better ideas for me please ?!
mfg panno

I have no idea what you're talking about... Maybe it's me being daft or you not being clear.

how about this:

let's say your gun, cannon or whatever can be rotated 360 degrees. Then at some angle the player may shoot.

Now do this:

if firebutton
 force_x#=sin(angle)*speed#
 force_y#=cos(angle)*speed#
 bullet_x#=gun_x#
 bullet_y#=gun_y#
endif

bullet_x#=bullet_x#+force_x#
bullet_y#=bullet_y#+force_y#

drawimage bullet, bullet_x#,bullet_y#


Please try to use capitalization, punctuation and better grammar (if possible).

I don't know where one sentence starts and another ends:
i stored the x,y pixelcoord. from the bresenham algo in a array
and draw then later,pixel by pixel because i need a shoot not a line
but this way is so nooby imho


sorry

I know this is verry confusing for People who dont know me.
Thanks for your Anwser`s and your Time.
Ps. Problem solved :)

Surprisingly I used to understood it without any problems :)