Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.Drawing
- Imports System.Drawing.Drawing2D
- Imports System.Windows.Forms
- Public Class Form1
- Public Structure Lobject ' The main objects in the game
- Dim size As System.Drawing.Color 'Magnitude of the object bassed on colour
- Dim links() As ArrayList 'but actually as link - links to other objects
- Dim position As Point 'position in the map
- Dim velocity As vector 'velocity
- Dim visible As PictureBox 'The picturebox to show the object
- Dim myref As Int16 ' a reference to itself
- Dim mytype() As Boolean 'size 2 - 01 = Red - 10 = green - 11 = blue - (00 = white #reserved for later update)
- End Structure
- Public Structure link 'The data type to explain links between objects
- Dim reference As Integer 'Reference to the other object
- Dim distance As Integer 'The distance must stay constant and so this is saved
- End Structure
- Public Structure vector
- Dim x As Integer 'Velocity in the X axis
- Dim y As Integer 'Velocity in the Y axis
- End Structure
- Dim ObjectList As New ArrayList ' but actually as Lobject
- Private Sub BRun_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BRun.Click
- 'Create pen to draw with its color and size
- Dim brush1 As New SolidBrush(Color.Blue)
- 'Create graphics object to draw onto
- Dim g As System.Drawing.Graphics
- 'for each object generate an "object"
- For i = 0 To 2
- 'Set the brush to the correct colour size
- 'link the graphics object and the picturebox
- g = ObjectList(i).visible.CreateGraphics
- 'Draw the elipsis with the pen
- g.FillEllipse(brush1, 25, 25, 50, 50)
- Next
- End Sub
- Private Sub BExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BExit.Click
- End
- End Sub
- Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
- BRun.Enabled = False
- Me.Refresh()
- 'A variable to set up the item before adding it to the arraylist
- Dim tempObject As Lobject
- 'set up each object
- For i = 0 To 2
- tempObject.position = New Point(ObjectList.Count * 100 + 100, 100)
- tempObject.size = System.Drawing.Color.FromArgb(0, 0, 255)
- tempObject.myref = ObjectList.Count
- tempObject.velocity.x = 0
- tempObject.velocity.y = 0
- ReDim Preserve tempObject.mytype(1)
- tempObject.mytype(0) = True
- tempObject.mytype(1) = True
- tempObject.visible = New PictureBox
- tempObject.visible.Name = "object#" & ObjectList.Count
- tempObject.visible.Parent = Me
- 'The next two are differnt from position because position is on the full map where as these are the position on the screen
- tempObject.visible.Left = 100 * i
- tempObject.visible.Top = 1
- tempObject.visible.Visible = True 'Confusing but the fist visible is of type picturebox and so has the attribute visible
- tempObject.visible.Height = 100
- tempObject.visible.Width = 100
- ObjectList.Add(tempObject)
- Next
- BRun.Enabled = True
- End Sub
- Sub RunThis()
- 'The functions that need to be achived in this subroutine are:
- '-The external interations
- '=Gravity of object which is popotional to the product of the aggregate colours over the distance squared
- '=Push from Light px pushing objects apart
- 'spin from links
- '=transpher rate
- '-The internal interations
- '=Object generates +3 of a color per turn
- '=Excces colour after traiding is sperted
- '=if all colour composits reach zero it disapears
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment