bullets

BlitzPlus Forums/BlitzPlus Programming/bullets

im a beginner how do i make bullets

make a particle system

check the code archives

Get some lead, melt it down, mold it into the shape that you want. The bigger the bullet the more damage it does. Good luck.

Unless you need to use them against werewolves, then you should use silver, however it has never been scientifically proven to work.
http://benchrest.com/articles/articles/4/1/Making-Bullets---Q-&-A-with-those-that-know
Graphics 800, 600, 0, 2
SetBuffer BackBuffer()

Type bullet
	Field x, y
	Field angle
End Type


px = 400
py = 300

Repeat

	Cls
	Text px, py, "<-*->", 1, 1
	
	If KeyDown(203) Then px = px - 5: rx = -1: ry =  0
	If KeyDown(205) Then px = px + 5: rx = +1: ry =  0
	If KeyDown(200) Then py = py - 5: rx =  0: ry = -1
	If KeyDown(208) Then py = py + 5: rx =  0: ry = +1
	
	If KeyHit(57) Then
		b.bullet = New bullet
		b\x = px
		b\y = py
		b\angle = newangle
		newangle = (newangle + 15) Mod 360
	End If
	
	For b.bullet = Each bullet
		Text b\x, b\y, b\angle, 1, 1
		b\x = b\x + Cos(b\angle) * 5
		b\y = b\y + Sin(b\angle) * 5
		If (b\x < 0) Or (b\x > 800) Or (b\y < 0) Or (b\y > 600) Then Delete b
	Next

	Text 0, 0, "use space to fire"	
	Flip
	
Until KeyHit(1)

End