Long time timeline coder here, had to learn classes for both Flash and C# for playerio.
I managed to get a multiplayer game working, where me and my friends controlled the pieces and all worked well.
I had a little bit of trouble working with classes in Flash, but eventually I figured it out because I had static variables and functions, which in a way resembled how I worked with in the Timeline.
However, from what I understand, you can't work with static methods and properties with playerio, so I got compeltely stuck and can't code anything other than the basic setup of my game.
Please bear in mind I'm not a professional programmer, and I have no idea how real class based projects are managed, and that reading books or the internet did not help me at all figure that out.
Let me show where I am stuck:
public class EnemyBalls
{ //enemy properties }
[RoomType("MyCode")]
public class GameCode : Game<Player>
{
//here I started setting up my first game variables
public List<EnemyBalls> enemyBallArray = new List<EnemyBalls> { null };
.... more code
Now, when the server receives the message "newGame", I tried calling a function to create enemyBalls of the type EnemyBalls and store them at the enemyBallArray.
But since I can't call any static functions, and I can't create/instantiate the enemies inside the GameCode class, I'm completely lost.
I can't create a class object to let me call functions, so where do I go from there?
(also, another doubt I had was why I can call -this- or instantiate a new class object from inside a class method, but not outside a method along with the properties? What is the reasoning behind that?)
Hope someone can help me