Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Walls and Barriers... I Need Some Help...
Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
DH88




PostPosted: Wed May 24, 2006 1:55 pm   Post subject: Walls and Barriers... I Need Some Help...

I'm attempting to create program with walls. It will be a sort of maze program, using keydowns and keyups to manipulate a simple sprite. My main problem is creating one wall, let alone multiple ones to nullify movement.

Does anyone know how to make a working wall, and what would you use?
ie; Picture boxes, lines, etc...

Any help would be appreciated. Hit Wall
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Wed May 24, 2006 3:18 pm   Post subject: (No subject)

I'd have a 2D (grid) array for the locations of walls. Then during movement, I'd be checking against the array to see if a move is valid or not.

The maze itself will also be drawn from the array, so that math and visuals are in sync.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Brightguy




PostPosted: Wed May 24, 2006 3:21 pm   Post subject: Re: Walls and Barriers... I Need Some Help...

You can use images for the walls if you want it to look fancier, otherwise you can use the line control or the line method. Obviously there are different ways to store the wall location internally. (e.g., one simple way would be to model the maze as a 2D grid where each wall is 1 cell.)
Display posts from previous:   
   Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: