Bottle

 My newest program, Bottle, involves a basic piece I did for an art class my senior year of high school. I decided to return to it four years later, as the message behind the piece still stands. There is a light at the end of the bottle for those on medication for mental health conditions, but you mustn't let your hands get trapped. The hands are the will of your creativity, your raw emotion.



Here is a screen capture and the code. VB Winforms.


Public Class Form1
Private flickerRainbow As Boolean
Private flickerLight As Boolean
Private handsXDirection As Single
Private handsYDirection As Single
Private handsXSpeed As Single
Private handsYSpeed As Single
Private handsXPos As Single = 0
Private handsYPos As Single = 0
Private handsWidth As Single = 200
Private handsHeight As Single = 180
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles
MyBase.Load
Timer1.Enabled = True
Timer1.Interval = 40
Timer1.Start()
Timer2.Enabled = True
Timer2.Interval = 60
Timer2.Start()
handsXDirection = 2 * Rnd() + 3
handsYDirection = 2 * Rnd() + 3
handsXSpeed = 4
handsYSpeed = 2
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles
Timer1.Tick
Label1.Invalidate()
flickerRainbow = Not flickerRainbow
End Sub
Private Sub Timer2_Tick(sender As Object, e As EventArgs) Handles
Timer2.Tick
Label1.Invalidate()
flickerLight = Not flickerLight
End Sub
Private Sub Label1_Paint(sender As Object, e As PaintEventArgs)
Handles Label1.Paint
Dim gr0 = e.Graphics
gr0.DrawImage(My.Resources.base_resized, 0, 0, 1000, 1022)
handsXPos += handsXSpeed * handsXDirection
handsYPos += handsYSpeed * handsYDirection
If handsXPos > 150 And handsXPos < 336 And handsYPos > 333 And
handsYPos < 712 Then
gr0.DrawImage(My.Resources.hands, 150, 577, 200, 180)
gr0.DrawImage(My.Resources.bottle_translucent, 86, 213, 294,
577)
Else

If (handsXPos < 0 Or handsXPos > (Label1.Width - handsWidth))
Then
handsXSpeed = -handsXSpeed
End If
If (handsYPos < 0 Or (handsYPos > Label1.Height -
handsHeight)) Then
handsYSpeed = -handsYSpeed
End If
gr0.DrawImage(My.Resources.bottle_transparent_resized, 86,
213, 294, 577)
gr0.DrawImage(My.Resources.hands, handsXPos, handsYPos,
handsWidth, handsHeight)
End If

If flickerRainbow = True Then
gr0.DrawImage(My.Resources.rainbow_resized, 349, 169, 573,
607)
Else
gr0.DrawImage(My.Resources.rainbow_translucent, 349, 169,
573, 607)
End If
If flickerLight = True Then
gr0.DrawImage(My.Resources.light_resized, 0, 398, 132, 144)
Else
gr0.DrawImage(My.Resources.light_translucent, 0, 398, 132,
144)
End If
End Sub
Private Sub Label1_DoubleClick(sender As Object, e As EventArgs)
Handles Label1.DoubleClick
Me.Close()
End Sub
End Class

Popular Posts