Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. game programming in vb.net

game programming in vb.net

Scheduled Pinned Locked Moved Visual Basic
csharpcssgame-devdocker
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vijaylumar
    wrote on last edited by
    #1

    hi My application is like a brick game where i have to fill the space with correct brick size. i have a large rectangular/square container in that container , i have to place small rectangles or squares so that there should be less wastage of space in the container. first my doubt is can we do this application using vb.net or .net if yes then can you give a little bit idea or a link which can be helpful to me to start this kind of application. thanking you in advance vijay kumar D

    L L P 3 Replies Last reply
    0
    • V vijaylumar

      hi My application is like a brick game where i have to fill the space with correct brick size. i have a large rectangular/square container in that container , i have to place small rectangles or squares so that there should be less wastage of space in the container. first my doubt is can we do this application using vb.net or .net if yes then can you give a little bit idea or a link which can be helpful to me to start this kind of application. thanking you in advance vijay kumar D

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      I don't have any links to offer, but I am sure Google has lots. This is really a mathematical problem where you need to create an array showing the empty spaces and then fill them with bricks. I assume that you know the algorithm to do this; the actual coding can be done in any language you choose.

      MVP 2010 - are they mad?

      1 Reply Last reply
      0
      • V vijaylumar

        hi My application is like a brick game where i have to fill the space with correct brick size. i have a large rectangular/square container in that container , i have to place small rectangles or squares so that there should be less wastage of space in the container. first my doubt is can we do this application using vb.net or .net if yes then can you give a little bit idea or a link which can be helpful to me to start this kind of application. thanking you in advance vijay kumar D

        L Offline
        L Offline
        Luc Pattyn
        wrote on last edited by
        #3

        you can do that perfectly with the .NET framework. you can do it with VB.NET, I would use C# but that is a personal preference of mine. I suggest you read some CodeProject articles on games. and you need to learn and help yourself, so search for those articles and start reading! :)

        Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


        I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that.
        [The QA section does it automatically now, I hope we soon get it on regular forums as well]


        1 Reply Last reply
        0
        • V vijaylumar

          hi My application is like a brick game where i have to fill the space with correct brick size. i have a large rectangular/square container in that container , i have to place small rectangles or squares so that there should be less wastage of space in the container. first my doubt is can we do this application using vb.net or .net if yes then can you give a little bit idea or a link which can be helpful to me to start this kind of application. thanking you in advance vijay kumar D

          P Offline
          P Offline
          Paul Roseby
          wrote on last edited by
          #4

          This sound to me very similar to a shipping logic problem. The below is defiantly not the answer but it is a start.

              Dim shapeArray(3, 2) As Integer
              Dim containerWidth As Integer = 11
              Dim containerHeight As Integer = 7
          
              shapeArray(0, 0) = 5
              shapeArray(0, 1) = 5
          
              shapeArray(1, 0) = 2
              shapeArray(1, 1) = 5
          
              shapeArray(2, 0) = 1
              shapeArray(2, 1) = 1
          
              shapeArray(3, 0) = 5
              shapeArray(3, 1) = 6
          
              Dim totalArea As Integer = 0
              For i As Integer = 0 To UBound(shapeArray)
                  totalArea += (shapeArray(i, 0) \* shapeArray(i, 1))
              Next
          
              If totalArea > (containerWidth \* containerHeight) Then
                  MsgBox("Shapes are unable to fit into container")
                  Exit Sub
              End If
          

          The above code basically checks to see if all the shapes will fit into the container/main box. You will perhaps need to sort the array into longest sides, then position the largest sized shapes into the box first. Also take into consideration that some of the shapes could potentially be rotated. Might be worth looking into logic/calculations for packing boxes as well as games development, Id be very interested to know if you find some good samples. Hope this helps.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups