March 05, 2021, 07:46:41 AM
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Like stats
Home
Forum
Help
Search
Gallery
Login
Register
SyntaxBomb - Indie Coders
»
Languages & Coding
»
Blitz Code Archives
»
Graphics
»
[bb] Bullets with trails by SillyPutty [ 1+ years ago ]
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: [bb] Bullets with trails by SillyPutty [ 1+ years ago ] (Read 413 times)
BlitzBot
Jr. Member
Posts: 1
Total likes: 0
[bb] Bullets with trails by SillyPutty [ 1+ years ago ]
«
on:
June 29, 2017, 12:28:40 AM »
Title :
Bullets with trails
Author :
SillyPutty
Posted :
1+ years ago
Description :
shooting bullets with trails, ala Crimsonland
Code :
Code: BlitzBasic
Strict
Framework brl.glmax2d
Import brl.
graphics
Import brl.linkedlist
SetGraphicsDriver GLMax2DDriver
(
)
AppTitle
=
"Bullet Test - by Erick 'Deux' Grove"
Graphics
800
,
600
,
0
AutoMidHandle
True
Global
bulletimage:TImage =
CreateImage
(
16
,
16
,DynamicImage|MaskedImage
)
Global
bulletList:TList
Type
bullet
Field
x#
Field
y#
Field
origin_x#
Field
origin_y#
Field
scale_factor#
Field
alpha_factor#
Field
life#
Method draw
(
)
SetColor
200
,
125
,
125
DrawRect x,y+
(
scale_factor*
5
)
,
3
,
5
SetScale
1
,scale_factor
SetColor
100
,
100
,
100
SetAlpha alpha_factor
DrawRect origin_x,origin_y,
3
,
5
SetScale
1
,
1
SetAlpha
1
End
Method
Method update
(
)
y:-
1
life:-
1
scale_factor:-
3
alpha_factor:-
0.03
If
(
alpha_factor <
0
)
ListRemove bulletList,Self
End
Method
End Type
bulletList = CreateList
(
)
Cls
SetColor
200
,
200
,
200
DrawRect
0
,
0
,
3
,
10
GrabImage
bulletimage,
0
,
0
SetBlend
(
alphablend
)
Function
UpdateBullets
(
)
For
Local
b:bullet = EachIn bulletList
b.Draw
(
)
b.Update
(
)
Next
End Function
While
Not
KeyDown
(
KEY_ESCAPE
)
SetScale
1
,
1
SetAlpha
1
If
KeyHit
(
KEY_SPACE
)
Local
mybullet:bullet =
New
bullet
mybullet.life =
100
mybullet.alpha_factor=
1
mybullet.x =
MouseX
(
)
mybullet.y =
MouseY
(
)
myBullet.origin_x = mybullet.x
myBullet.origin_y = mybullet.y
bulletList.addLast
(
mybullet
)
End If
UpdateBullets
(
)
Flip
Cls
Wend
FlushMem
End
Comments :
SillyPutty(Posted 1+ years ago)
btw, this is bmax code, i dont see how i can edit this entry to move it to the bmx filter.
clownhunter(Posted 1+ years ago)
You need to get rid of FlushMem.
kfprimm(Posted 1+ years ago)
this was posted a year ago...
Logged
Print
Pages: [
1
]
Go Up
« previous
next »
SyntaxBomb - Indie Coders
»
Languages & Coding
»
Blitz Code Archives
»
Graphics
»
[bb] Bullets with trails by SillyPutty [ 1+ years ago ]
SimplePortal 2.3.6 © 2008-2014, SimplePortal