game programming in vb.net
-
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
-
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
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?
-
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
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]
-
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
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.