Help: Tile based game
Help: Tile based game
Help: Tile based game
Help: Tile based game
Help: Tile based game
Help: Tile based game Help: Tile based game Help: Tile based game Help: Tile based game Help: Tile based game Help: Tile based game Help: Tile based game Help: Tile based game
Help: Tile based game Help: Tile based game
Help: Tile based game
Go Back  Xtreme Visual Basic Talk > > > Help: Tile based game


Reply
 
Thread Tools Display Modes
  #1  
Old 05-29-2009, 08:16 PM
assassanation assassanation is offline
Newcomer
 
Join Date: May 2009
Posts: 4
Default Help: Tile based game


im new to VB and i am doing a tile based game for school. Thoe i am far from done i am having trouble with the tile placement. i was wondering if someone could help. My problem is that it displays all water tiles when the map array has water and grass tiles. Can some one plz take a look and see if they can help. There are also more mistakes i have made and i would appreciate it if u pointed thoes out aswell, thanx.

Edit: Fixed my Game a little but have the sam problem still

vvvvvvvvvvvvvvv- I attached the game bellow -vvvvvvvvvvvvvvvvvv
Attached Files
File Type: zip Game.zip (5.5 KB, 16 views)

Last edited by assassanation; 05-29-2009 at 08:28 PM.
Reply With Quote
  #2  
Old 05-29-2009, 08:42 PM
Flamespewer Flamespewer is offline
Freshman
 
Join Date: Sep 2008
Posts: 35
Default

I myself enjoy using 2d arrays for maps, when i move a character i can just check the coordinates of the character to the map and determine if he/she can move or not.

i'd put your array into a .txt file
Code:
1111111111
1000000001
1000000001
1000000001
1000000001
1111001111
1000000001
1000000001
1000000001
1000000001
1111111111
then i would load it into a 2d-array
Code:
Open File For Input As Number
    For i = 0 To MaxMapx
        For j = 0 To MaxMapY
            Map(i, j) = Number
        Next j
    Next i
Close Number
then put it onto the screen like this(i usually use bitblt)

Code:
For x = 0 To 1
    For y = 0 To 1
        Select Case map(x, y)
            Case 1
                Form.PaintPicture Image1.Picture, x * 16, y * 32
            Case 2
                Form.PaintPicture Image2.Picture, x * 16, y * 32
        End Select
    Next y
Next x

Last edited by Flamespewer; 05-29-2009 at 08:53 PM.
Reply With Quote
  #3  
Old 05-30-2009, 02:23 PM
assassanation assassanation is offline
Newcomer
 
Join Date: May 2009
Posts: 4
Default

Thanx for the helping but could u show me what the code would look like cuz i tried but am getting errors like "Wrong Number of dimensions"
Reply With Quote
  #4  
Old 05-30-2009, 03:45 PM
Flamespewer Flamespewer is offline
Freshman
 
Join Date: Sep 2008
Posts: 35
Default

well im not going to give you code, because your doing a project, but if its a problem with dimensions make sure your array is the right size.
Reply With Quote
  #5  
Old 06-01-2009, 04:19 AM
AdrianDeAngelis's Avatar
AdrianDeAngelis AdrianDeAngelis is offline
Contributor
 
Join Date: May 2005
Location: Australia
Posts: 549
Default

Do a search of the forum using the search button in the top right corner and you will find so many discussions regarding making a tile based game as well as complete working code in many instances...

You can find heaps of tutorials on the internet as well... try lucky's VB gaming site (now the gamingwiki or something similar).
__________________
Automation error... What do you mean automation error you %#@*&!$ thing!

Star Admiral: 3D tactical space sim *** New Version 0.38 10/01/09 ***
Damage, shields and special weapons systems
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Help: Tile based game
Help: Tile based game
Help: Tile based game Help: Tile based game
Help: Tile based game
Help: Tile based game
Help: Tile based game Help: Tile based game Help: Tile based game Help: Tile based game Help: Tile based game Help: Tile based game Help: Tile based game
Help: Tile based game
Help: Tile based game
 
Help: Tile based game
Help: Tile based game
 
-->