Movement in a board game
Movement in a board game
Movement in a board game
Movement in a board game
Movement in a board game
Movement in a board game Movement in a board game Movement in a board game Movement in a board game Movement in a board game Movement in a board game Movement in a board game Movement in a board game
Movement in a board game Movement in a board game
Movement in a board game
Go Back  Xtreme Visual Basic Talk > > > Movement in a board game


Reply
 
Thread Tools Display Modes
  #1  
Old 01-21-2012, 10:34 PM
gorilla gorilla is offline
Newcomer
 
Join Date: Jan 2012
Posts: 2
Question Movement in a board game


So I'm creating quite a simple board game in vb 6 and I need help in the movement.

The images for each "tile" on the board (each one the same size) are in a control array (img 0-19). There are 7 tiles horizontally, 5 vertically.

Now I would like to know how I could move a board piece/image across the board using a die mechanic.

Some example coding would be appreciated alongside suggestions!
Reply With Quote
  #2  
Old 01-21-2012, 10:36 PM
gorilla gorilla is offline
Newcomer
 
Join Date: Jan 2012
Posts: 2
Default

I would also like to add I'm a complete newbie when it comes to arrays...
Reply With Quote
  #3  
Old 01-26-2012, 06:50 PM
passel's Avatar
passelMovement in a board game passel is offline
Sinecure Expert

Super Moderator
* Guru *
 
Join Date: Jun 2003
Location: Upstate New York, usa
Posts: 8,026
Default

You said game in vb 6, but you posted in the .Net game forum, rather than the legacy (vb4,5,6) side.
Probably the simplest for a newbie would be to set up a control array of images for your 7x5 grid. You can then assign pictures from your tile array to a given picture of your game board, i.e. somthing like.
Assume you number Cols 0 to 6 and Rows 0 to 4
Assume Col = 5 and Row = 3
The 35 tile game board would be an array from 0 to 34.
Assuming you positioned the game board array like
0 ... 6
7 ... 13
14 ... 20
21 etc...

to convert Col, Row into the linear 0 to 34, it would be idx = (Row * 7) + Col
so, with the 5,3 example that would be 7*3 + 5 so idx would equal 26.
Board(Idx).Picture = Tile(?).Picture

You may need an image that represents an empty board position.
As for movement, probably more detail on your game would be needed, like how does your "die mechanic" correlate to board movement?
__________________
There Is An Island Of Opportunity In The Middle of Every Difficulty.
Miss That, Though, And You're Pretty Much Doomed.
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
Movement in a board game
Movement in a board game
Movement in a board game Movement in a board game
Movement in a board game
Movement in a board game
Movement in a board game Movement in a board game Movement in a board game Movement in a board game Movement in a board game Movement in a board game Movement in a board game
Movement in a board game
Movement in a board game
 
Movement in a board game
Movement in a board game
 
-->