2D Collision Problem.
2D Collision Problem.
2D Collision Problem.
2D Collision Problem.
2D Collision Problem.
2D Collision Problem. 2D Collision Problem. 2D Collision Problem. 2D Collision Problem. 2D Collision Problem. 2D Collision Problem. 2D Collision Problem. 2D Collision Problem.
2D Collision Problem. 2D Collision Problem.
2D Collision Problem.
Go Back  Xtreme Visual Basic Talk > > > 2D Collision Problem.


Reply
 
Thread Tools Display Modes
  #1  
Old 04-10-2010, 07:26 PM
VbNerd96's Avatar
VbNerd96 VbNerd96 is offline
Freshman
 
Join Date: Dec 2009
Posts: 33
Default 2D Collision Problem.


Ok, so, I have been building a game, a very simple one but one that contained my idea of a two-player game, And I came across a problem involving collision detection-- Between a line and a circle.

I've attached the project.

The problem I've been having trouble with is the Function in the Class bullet.

I would vastly appreciate any help.

Thx in Advanced.
Attached Files
File Type: zip Morph-Circle 2.0.zip (3.4 KB, 15 views)
__________________
Je reste fidèle à la cause... Des langue programmation de VB6!
Reply With Quote
  #2  
Old 04-12-2010, 10:54 PM
FireBot FireBot is offline
Centurion
 
Join Date: Mar 2008
Posts: 100
Default

Basically, you'll want to calculate the vector for the movement of the circle, and see if it intersects the line, if so you'll want to then calculate the collision, and the resulting vector for the ball.
Reply With Quote
  #3  
Old 04-14-2010, 04:11 AM
surfR2911 surfR2911 is offline
Contributor
 
Join Date: Oct 2009
Posts: 719
Default More collision help needed

After looking at the Morph_Circle attachment I really think VbNerd96 needs a lot more help than a brief verbal explanation Firebot provided.

Forum member IcePlug has already covered managing bullets and collision detection in the forums' Code Library.
Here's a link for "Managing Bullets" (thread also has link to Collisions and Overlaps thread):
Managing Bullets in a game.

I think your game also needs a Circle-Circle collision test (with possibly an If..Then statement that stops firing when the two circles are in collision).
There's a nice sample of detecting circle-circle collisions attached to this tutorial page:
http://www.rookscape.com/vbgaming/tutAP.php

And although I think Iceplug's bullet control array approach is more sophisticated, if you want to stick with collision detection of drawn lines and circles I'll attach a simple sample of that..
Attached Files
File Type: zip Line-Circle_Collision_Sample.zip (1.8 KB, 11 views)

Last edited by surfR2911; 04-14-2010 at 04:16 AM.
Reply With Quote
  #4  
Old 04-14-2010, 04:32 AM
FireBot FireBot is offline
Centurion
 
Join Date: Mar 2008
Posts: 100
Default

I provided plenty of helpful search terms.

Might I also suggest the Game Programming Wiki, very well written articles on nearly every aspect of game programming(including collision detection). And there's a whole section of them just for classic VB! So you get real working VB code examples.
Reply With Quote
  #5  
Old 04-29-2010, 04:53 AM
DreamingInCode DreamingInCode is offline
Newcomer
 
Join Date: Apr 2010
Posts: 4
Default

I had the same problem when I started making a game like this, although in my case it was a meteor and a ufo..
Still, the only conclusion I came to was to discern a value for the player's x and y coordinate, and a value for the enemies x and y coordinates, and see if at any point they are the same. If you wanna make it a bit broader.. then you could try giving a bit of lee-way.. having the collision based on being between 2 values of x..
Hope this helps, and I'm sorry if this is no help at all, this is only my second post after all.
Reply With Quote
Reply

Tags
collision


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
2D Collision Problem.
2D Collision Problem.
2D Collision Problem. 2D Collision Problem.
2D Collision Problem.
2D Collision Problem.
2D Collision Problem. 2D Collision Problem. 2D Collision Problem. 2D Collision Problem. 2D Collision Problem. 2D Collision Problem. 2D Collision Problem.
2D Collision Problem.
2D Collision Problem.
 
2D Collision Problem.
2D Collision Problem.
 
-->