# Class Design

**URL:** <https://forum.kirupa.com/t/class-design/201593>\
**Category:** flash\
**Created:** [September 22, 2006, 7:21pm UTC](https://forum.kirupa.com/t/class-design/201593 "2006-09-22T19:21:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Balala](https://avatars.discourse-cdn.com/v4/letter/b/df705f/32.png) [@Balala](https://forum.kirupa.com/u/Balala)\
**Post date:** [September 22, 2006, 7:21pm UTC](https://forum.kirupa.com/t/class-design/201593/1 "2006-09-22T19:21:36Z")

</div>

Hi!

Recently I’ve start develop a Flash Game. While I was designing the classes via UML, none problems I’ve found.

Now, applying to Flash, I’ve get so much confused =/

By the logic, I get that far:

**package/classes**

```auto
Game &gt; Game class
characters/ICharacter.as &gt; Interface
characters/*.as &gt; Characters Classes
terrain/Map.as &gt; Map Class**

The problem:

The Game class has 2 properties:

**private var player:ICharacter;
private var terrain:Map;**

Now, if I have to check if player is hitting the terrain, when creating the **new Player()**, I have to pass the **terrain** property as parameter, and hold that property in Player class (Character).

I dont think that is correct... By convention, we should only extend a class if the **subclass if a type of super** , and create property if the **super has a type of subclass**. This is what im doing.

**Game has a Player, and has a Terrain**

So, im suppose to keep this Class Design? Or I must rethink on it?

Thanks in advance.
:drool:
```
