|
-
Dec 3rd, 2001, 07:01 PM
#1
Thread Starter
Fanatic Member
Collision detection and other woes
I decided it might be fun to "knock out" a game or two.
as all they seem to want to teach me is database access I realised I was going to have to teach myself this stuff.
I've got clear in my mind the static background, scrolling background and scrolling foreground.
The trouble is I would really rather avoid useing a massive set of tiles to program the play area itself.
Is there anyway I can draw the level, mask the fella and then use a simple(ish) set of calls to see if my non-discript charicter should stop falling now please.
Then that opens up the head ach of acurately locating enimies die when you tutch this thing, things etc.
I think I may need to use a whole new approach but it's got me beat.
Any help on this would be very cool as I refuse to start a program until I know exactly how I inteand to go about it.
-
Dec 3rd, 2001, 08:37 PM
#2
transcendental analytic
Can you give me some geometrical background, collision detection is a fairly simple geometrical principle, but i need some parmeters so that i know what simplifications can be performed.
1. how many dimensions?
2. What shapes of objects?
3. What kind of movement?
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Dec 3rd, 2001, 08:52 PM
#3
Thread Starter
Fanatic Member
a good long sideways scrolling screen.
Left and right with some jumping (and falling) so up and down as well although a lot more down than up.
nice rectangual platforms hidiously iregualy other things currently existing as a nice long BMP (static bits anyway)
Just what else the as yet undecidedly shaped hero will be and his equally defined areas of doubt and uncertainty baddies depends largly on if I come across any decent BMPs in my travles.
sorry I can't be more specific I've only being working on this idea a few days.
-
Dec 3rd, 2001, 09:04 PM
#4
transcendental analytic
about the hidiously iregualy other things, can they be approximated to rectangles as well or ellipses or even circles? (rectangles to prefer)
All rectangles are perpendicular to each other?
The "level" rectangles are bound to a map matrix or just floating around? are they all same size and square?
Does the irregular shapes bump into each other?
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Dec 3rd, 2001, 09:16 PM
#5
Thread Starter
Fanatic Member
erm yes no, maybe
the main static thing will aproximate to an equalatral triangle coz it'll look ace. (I hate trig maths it does my head in)
platforms very rectangle
i guess i could keep the bad guys pritty much elipsoidical
I was hopeing I could get away with drawing a bmp file and masking it then telling vb don't move movable thing if it hits non transparrent bit then I could give an aprox location for items and have them drop till they land on a platform!
ladders and floaty up and down I hoped to tell go float nearish to this bit etc.
was also hopeing to slap in a few invisible markers to play amusing noises when encountered.
I'm thinking my draw it and apply a nice simple (ish) engine is going to become a thing of the past.
-
Dec 3rd, 2001, 09:53 PM
#6
transcendental analytic
Okay you have ellipses, triangles, rectangles (can they be angled?) what collisions between these?
btw forget about going trough the rasters, it'll hog up lots of performance if you have them running on objects trouh each frame. Also what amount of objects (about) do you have moving at the same time. Collision detection will hog up in rate of permutations between them so better keep it reasonable or else you would need a bsp tree which is pretty much opposite to the simpleness you want :/
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Dec 3rd, 2001, 10:44 PM
#7
Thread Starter
Fanatic Member
I was thinging about 5 to 10 elips types "running" around and maybe six or seven up/down rectangles plus five or size left/right.
Colision detection would mainly be of the stop falling here order.
as well as the can't walk here coz its a wall (duh) order as well.
oh yes and the very important tutch the triangle and die type.
was considering the old tutch it to collect it thing as well.
-
Dec 3rd, 2001, 11:13 PM
#8
transcendental analytic
ok, I assume they are all perpendicular, most sidescrolling games i've seen has it that way.
We define the ellipses, btw we can pretty much use rectangles instead for collection between them and walls/floors, as:
A,A+C
A being offset vector and C being the size of the sprite.
Collision between any of them and any rects (a,a+c) is pretty straigh forward:
A.x+C.x>a.x and A.x<a.x+c.x and A.y+C.y>a.y and A.y<a.y+c.y
About the triangle, can you approximate it as a rectangle as well? that would help.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Dec 4th, 2001, 01:57 PM
#9
Thread Starter
Fanatic Member
Ok thanks I think I follow.
I guess I could approx the triangle to rectangles but the collision detection might look a bit cack.
Thanks for the help tho... My brain will now go and craw under the carpit for a bit.
-
Dec 5th, 2001, 10:53 AM
#10
Thread Starter
Fanatic Member
I must confess that I don't fully follow.
-
Dec 6th, 2001, 08:10 PM
#11
transcendental analytic
Okay (sorry for the delayed reply) i am willing to explain again, if you don't understand something.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Dec 7th, 2001, 05:50 PM
#12
Frenzied Member
You should definately go for a tile engine
-
Dec 7th, 2001, 07:27 PM
#13
Thread Starter
Fanatic Member
Originally posted by kedaman
A being offset vector and C being the size of the sprite.
Collision between any of them and any rects (a,a+c) is pretty straigh forward:
A.x+C.x>a.x and A.x<a.x+c.x and A.y+C.y>a.y and A.y<a.y+c.y
About the triangle, can you approximate it as a rectangle as well? that would help.
with all that algibra after such a long time (6 years) my mind is simply boggling and refuses to process the information.
Sorry to be dense do you think you could break it down for us old fickos.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|