jhylands

End of session 1

Aug 11th, 2012
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 3.77 KB | None | 0 0
  1. Imports System.Drawing
  2. Imports System.Drawing.Drawing2D
  3. Imports System.Windows.Forms
  4. Public Class Form1
  5.     Public Structure Lobject ' The main objects in the game
  6.         Dim size As System.Drawing.Color 'Magnitude of the object bassed on colour
  7.         Dim links() As ArrayList 'but actually as link - links to other objects
  8.         Dim position As Point 'position in the map
  9.         Dim velocity As vector 'velocity
  10.         Dim visible As PictureBox 'The picturebox to show the object
  11.         Dim myref As Int16 ' a reference to itself
  12.         Dim mytype() As Boolean 'size 2 - 01 = Red - 10 = green - 11 = blue - (00 = white #reserved for later update)
  13.     End Structure
  14.     Public Structure link 'The data type to explain links between objects
  15.         Dim reference As Integer 'Reference to the other object
  16.         Dim distance As Integer 'The distance must stay constant and so this is saved
  17.     End Structure
  18.     Public Structure vector
  19.         Dim x As Integer 'Velocity in the X axis
  20.         Dim y As Integer 'Velocity in the Y axis
  21.     End Structure
  22.     Dim ObjectList As New ArrayList ' but actually as Lobject
  23.  
  24.     Private Sub BRun_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BRun.Click
  25.         'Create pen to draw with its color and size
  26.         Dim brush1 As New SolidBrush(Color.Blue)
  27.         'Create graphics object to draw onto
  28.         Dim g As System.Drawing.Graphics
  29.         'for each object generate an "object"
  30.         For i = 0 To 2
  31.             'Set the brush to the correct colour size
  32.  
  33.             'link the graphics object and the picturebox
  34.             g = ObjectList(i).visible.CreateGraphics
  35.             'Draw the elipsis with the pen
  36.             g.FillEllipse(brush1, 25, 25, 50, 50)
  37.         Next
  38.  
  39.     End Sub
  40.  
  41.     Private Sub BExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BExit.Click
  42.         End
  43.     End Sub
  44.  
  45.     Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  46.         BRun.Enabled = False
  47.         Me.Refresh()
  48.         'A variable to set up the item before adding it to the arraylist
  49.         Dim tempObject As Lobject
  50.         'set up each object
  51.         For i = 0 To 2
  52.             tempObject.position = New Point(ObjectList.Count * 100 + 100, 100)
  53.             tempObject.size = System.Drawing.Color.FromArgb(0, 0, 255)
  54.             tempObject.myref = ObjectList.Count
  55.             tempObject.velocity.x = 0
  56.             tempObject.velocity.y = 0
  57.             ReDim Preserve tempObject.mytype(1)
  58.             tempObject.mytype(0) = True
  59.             tempObject.mytype(1) = True
  60.             tempObject.visible = New PictureBox
  61.             tempObject.visible.Name = "object#" & ObjectList.Count
  62.             tempObject.visible.Parent = Me
  63.             'The next two are differnt from position because position is on the full map where as these are the position on the screen
  64.             tempObject.visible.Left = 100 * i
  65.             tempObject.visible.Top = 1
  66.             tempObject.visible.Visible = True 'Confusing but the fist visible is of type picturebox and so has the attribute visible
  67.             tempObject.visible.Height = 100
  68.             tempObject.visible.Width = 100
  69.             ObjectList.Add(tempObject)
  70.         Next
  71.         BRun.Enabled = True
  72.  
  73.     End Sub
  74.  
  75.     Sub RunThis()
  76.         'The functions that need to be achived in this subroutine are:
  77.         '-The external interations
  78.         '=Gravity of object which is popotional to the product of the aggregate colours over the distance squared
  79.         '=Push from Light px pushing objects apart
  80.         'spin from links
  81.         '=transpher rate
  82.         '-The internal interations
  83.         '=Object generates +3 of a color per turn
  84.         '=Excces colour after traiding is sperted
  85.         '=if all colour composits reach zero it disapears
  86.  
  87.  
  88.     End Sub
  89. End Class
Advertisement
Add Comment
Please, Sign In to add comment