How to stop images from moving past objects
How to stop images from moving past objects
How to stop images from moving past objects
How to stop images from moving past objects
How to stop images from moving past objects
How to stop images from moving past objects How to stop images from moving past objects How to stop images from moving past objects How to stop images from moving past objects How to stop images from moving past objects How to stop images from moving past objects How to stop images from moving past objects How to stop images from moving past objects
How to stop images from moving past objects How to stop images from moving past objects
How to stop images from moving past objects
Go Back  Xtreme Visual Basic Talk > > > How to stop images from moving past objects


Reply
 
Thread Tools Display Modes
  #1  
Old 06-08-2009, 09:08 PM
Spino Prime Spino Prime is offline
Newcomer
 
Join Date: Jun 2009
Posts: 3
Question How to stop images from moving past objects


Hey sorry to bug you guys but I am currently working on an RPG for computer programing class on visual basic 6.0. It has been going well so far except for one small problem I have found.

I currently have an overhead view of an area and the player (as an image box) and you move him with command buttons (one for up one for down etc) i will change that to arrow keys latter. But in the game there are certain walls that I dont want the character to pass through and some objects that when the character bumps into will move to a new form.

Right now I have
imgCharacter.left -260 for my left button
imgCharacter.left +260 for my right
imgCharacter.left imgCharacter.top -260 for my up
and
imgCharacter.left imgCharacter.top +260 for my down

How do I make it so it will colide with shapes for my walls. Any help is appreciated.
Reply With Quote
  #2  
Old 06-08-2009, 10:02 PM
wolfstrike's Avatar
wolfstrike wolfstrike is offline
Junior Contributor
 
Join Date: Aug 2004
Posts: 336
Default

there's not enough info.

what are the walls and items made out of?

the way you are doing it the only way you can make collision is to compare the locations of the character vs the walls and items
__________________
The Pho·net·ic Programmer
Reply With Quote
  #3  
Old 06-09-2009, 06:07 AM
Spino Prime Spino Prime is offline
Newcomer
 
Join Date: Jun 2009
Posts: 3
Default

The walls are currently shapes.
Reply With Quote
  #4  
Old 06-09-2009, 09:21 AM
Qua's Avatar
QuaHow to stop images from moving past objects Qua is offline
Impetuous & volatile

* Expert *
 
Join Date: Apr 2005
Posts: 2,177
Default

Check out this article on collision detection.
__________________
Reading is the foundation for all knowledge - Unknown.
Reply With Quote
  #5  
Old 06-11-2009, 05:36 PM
Spino Prime Spino Prime is offline
Newcomer
 
Join Date: Jun 2009
Posts: 3
Default

Sry i couldnt respond earlier but that article helped out a bit I am going to try stuff for my game later. I will post again if I am still having trouble.
Reply With Quote
  #6  
Old 06-11-2009, 08:03 PM
Qua's Avatar
QuaHow to stop images from moving past objects Qua is offline
Impetuous & volatile

* Expert *
 
Join Date: Apr 2005
Posts: 2,177
Default

Remember, to detect whether one shape is about to cross another shape you will need to know the type of shape of both the objects (rectangle, circle, pentagon ect). Then you can use the method discussed in the article to do the actually detection.
__________________
Reading is the foundation for all knowledge - Unknown.
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
How to stop images from moving past objects
How to stop images from moving past objects
How to stop images from moving past objects How to stop images from moving past objects
How to stop images from moving past objects
How to stop images from moving past objects
How to stop images from moving past objects How to stop images from moving past objects How to stop images from moving past objects How to stop images from moving past objects How to stop images from moving past objects How to stop images from moving past objects How to stop images from moving past objects
How to stop images from moving past objects
How to stop images from moving past objects
 
How to stop images from moving past objects
How to stop images from moving past objects
 
-->