realbasic-games
[Top] [All Lists]

Re: object subclasses doing their own thing

To: REALbasic Games <realbasic-games at lists dot realsoftware dot com>
Subject: Re: object subclasses doing their own thing
From: Lars Jensen <larsjensen at rcn dot com>
Date: Sat, 26 Jun 2004 02:18:14 -0400
Delivered-to: realbasic-games at lists dot realsoftware dot com
List-help: <mailto:realbasic-games-request@lists.realsoftware.com?subject=help>
List-id: REALbasic Games <realbasic-games.lists.realsoftware.com>
List-post: <mailto:realbasic-games@lists.realsoftware.com>
> I tried a sample project to see if I could just have an array that
> holds GameObjects, and I could append whatever subclass of GameObject
> to it I wanted (i.e append a PlayerObject, then append a few
> EnemyObjects, whatever...). Then I could just say myArray(i).nextframe
> and it would do the nextframe for the appropriate subclass. (i.e. if
> myArray(i) had been added as an EnemyObject, it would execute the
> nextframe method as written in the EnemyObject subclass.)
> 
> Well, that doesn't work (I didn't see how it could, but thought I'd
> try).

It's a common enough approach; did you actually try it? If so, what problem
did you run into?

lj

_______________________________________________
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>