-5
\$\begingroup\$

UML diagram + explanations.

UML diagram of Panda and Hero descending from Entity

Bonus if I can make it happen in Java.
Also killing panda is bad =)

\$\endgroup\$
  • \$\begingroup\$ Sorry, you're going to have to do better than that to get me to click on your link. Some text? Explanation? Description? \$\endgroup\$ – Chris Garrett Jul 23 '10 at 15:11
  • \$\begingroup\$ @Chris it's a legit UML diagram \$\endgroup\$ – Bryan Denny Jul 23 '10 at 15:12
  • \$\begingroup\$ Now that i know the name, next time i'll use something more convenient than paint.net :s \$\endgroup\$ – hide Jul 23 '10 at 15:18
  • 3
    \$\begingroup\$ Could you put most of the text into the body of this post? Images work best as additional information, not the entire content. \$\endgroup\$ – Colin Gislason Jul 23 '10 at 15:25
  • \$\begingroup\$ I tried to inline the images, and it turns out the links provided were both dead. I am not sure what we are left with, here, but it certainly is not a question. \$\endgroup\$ – Gnemlock May 18 '17 at 3:21
2
\$\begingroup\$

These gameplay features can be broken into several domains:

Collision checking

How do you know that the panda's have met? How do you know the evil hero has slain a panda?

Scene management

How do you keep track of all the entities in a scene? How do you destroy entities? How do you create new ones?

First, scene management. An easy way to keep track of everything in your scene is just to make a list. Then, when you want to make a new entity or destroy one, it either adds or deletes it from the list. Simple.

Then, because you have your list of entities, you can have very basic collision checking by simply checking every item in your list with the other items. Just calculate the distances and see if they're close enough to collide.

And that should give you a general idea of how to solve these problems. :)

\$\endgroup\$
  • \$\begingroup\$ evil hero? What, just cause he slaid a panda? :) \$\endgroup\$ – Steven Evers Jul 23 '10 at 15:56
1
\$\begingroup\$

This is honestly kind of ridiculous. You've gone and created an object hierarchy without even considering how instances of the object interact. Where's your infrastructure? Where are the object containers? How do you handle locality? Et cetera.

Get yourself to interacting non-ojects in the world, then do your abstractions after that. You don't make a car by styling the interior then filling in the mechanics afterwards.

\$\endgroup\$
  • \$\begingroup\$ About all the question : I don't know ! I can only know what i learned and game programming books mostly don't teach this or i'm not reading the good books/websites. Please just direct me. \$\endgroup\$ – hide Jul 23 '10 at 17:46
  • \$\begingroup\$ Also, a lot is managed by the library, lwjgl.slick and as far as i can tell it's fairly similar to XNA, pygame and others. So i don't worry too much about the foundation of a game. \$\endgroup\$ – hide Jul 23 '10 at 18:06
  • \$\begingroup\$ But that's what his question was really about, object interaction. \$\endgroup\$ – CiscoIPPhone Oct 25 '10 at 16:44

Not the answer you're looking for? Browse other questions tagged or ask your own question.