Monday, April 23, 2012

How to Clone a child of an abstract class in WP7 XNA

I'm working on a game for WP7 with XNA. Here is my structure:

public abstract class enemy

Child elements:

public class genericEnemy : enemy{}
public class snake : enemy {}


In WP7, a lot of things have been moved around and/or removed (especially with Serialization) it seems. Despite much searching, I haven't been able to find a solution. I'm trying to duplicate the child elements.

For example: On loading a level, I pass an array of three different enemies into the loading phase. During loading, I need to duplicate each of those enemies so that 20 of each are flying around doing their own thing during gameplay.

All the solutions I've seen refer to things that are not present in the WP7 library.

No comments:

Post a Comment