Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

spillsome

pengo and the ice blocks

This topic is 6153 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Anybody remember Pengo ?? for those who don''t know the game. It''s a SEGA game . You play as a penguin in a 2d maze of ice blocks which you can push around to try to kill monsters. I would like to make a pengo in 3d (to learn direct3d) and i don''t know how to check if the penguin hit a ice block or not. Should i use collision detection, or should i use an array filled with the positions of the ice blocks. what is better ?

Share this post


Link to post
Share on other sites
Advertisement
Actually, you''d better use collision detecten even if you''ve got an array.

I''d recommend using an array (or if you prefer, a linked list) for all ice blocks. Then just check for collision by looping through the array and calling your collision detection function. err..

/john
*Save GameDev - donate*

Share this post


Link to post
Share on other sites
Hey, I loved that game Pengo. A 3d Version would
be great. Do you remember a 2d game called Dig Dug,
Quantum ? They where my favs. I''d like to see them in
3D. But I digress.

Yea, I would use collision detection for all your
objects. Maybe a simple bounding box test might be enough.
If there is no rotation on your ice blocks, then you
could extract a bounding box from your verticies. It is
easier if you change your verticies manually.

Another option is to construct a bounding box around
the center position of the ice block. This way, you
don''t have to extract the box from the verticies.
If there is no movement on the y-axis then a bounding
square should do the trick. Just test along x and z axis.

< May the source be with you >

Share this post


Link to post
Share on other sites
You could even use both methods to have a fast and accurate collision detection. First, you easily detect ice cubes which are near the player with your 2D array. After that, you only do your collision test for these blocks. This way, you should save a lot of CPU time without sacrifing accuracy.

Share this post


Link to post
Share on other sites
I can''t believe it, I thought about pengo just yesterday and about how great game it was....

anyway, I think the option of first an array detection and then collision detection is a very good choice, since each cube (monster or penguin( can be (at most) in two cells of the array, so it saves you time to find the couples on which you would do collision detection.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!