shooting in 2d

Blitz3D Forums/Blitz3D Beginners Area/shooting in 2d

Panno(Posted 2004) [#1]
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


Rob Farley(Posted 2004) [#2]
I have no idea what you're talking about... Maybe it's me being daft or you not being clear.


jfk EO-11110(Posted 2004) [#3]
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#



WolRon(Posted 2004) [#4]
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



Panno(Posted 2004) [#5]
sorry

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


jfk EO-11110(Posted 2004) [#6]
Surprisingly I used to understood it without any problems :)