Author Topic: What's a class ?  (Read 996 times)

Dysp

  • New Member
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
What's a class ?
« on: Sun, Aug 14, 2011 »
Hi, I just don't get what a class is, every tutorial I read didn't actually explain what a class is.

Thanks.

01010111

  • Member
  • **
  • Posts: 48
  • Karma: +0/-0
    • View Profile
Re: What's a class ?
« Reply #1 on: Sun, Aug 14, 2011 »
Sorry, I'm super new to all of this, but from what I understand, a class is a template for setting up objects. Objects can be anything, such as sprites, different states, etc., that are instanced from their class.

So you have one class that you run initially that can call in other classes.

In Flixel, the main container class is FlxGame, which kind of initializes everything, inside that you have different States (FlxState), which can be anything from Title Screens, to different "levels" and Game Over screens. In the different states, other classes are called, so for a title screen, you have instances of Sprite classes for graphics like the title graphic etc. etc. and then instances of the FlxText class for some instructions like "Press X to Start".

Like I said, I'm totally new to Flixel and programming, so I may need some correcting myself, but this is how I understand it.

Wing Eraser

  • Guest

photonstorm

  • Administrator
  • Key Contributor
  • *****
  • Posts: 1502
  • Karma: +1/-0
    • View Profile
    • Photon Storm
Re: What's a class ?
« Reply #3 on: Sun, Aug 14, 2011 »
You need to learn AS3 before you can really get anywhere with Flixel. I'd suggest you start here:

http://www.photonstorm.com/archives/1351/learning-actionscript-3-here-are-some-great-books
http://www.photonstorm.com



"Tell me and I will forget, show me and I might remember, involve me and I will understand" - Confucius

01010111

  • Member
  • **
  • Posts: 48
  • Karma: +0/-0
    • View Profile
Re: What's a class ?
« Reply #4 on: Sun, Aug 14, 2011 »
You need to learn AS3 before you can really get anywhere with Flixel. I'd suggest you start here:

http://www.photonstorm.com/archives/1351/learning-actionscript-3-here-are-some-great-books
+1

After reading that post and being very confused about some syntax I went out and got a copy of the O'Reilly AS3 Cookbook. The first chapter alone cleared up SO MUCH confusion.

btw, thanks for the recommendation Photonstorm!

Dysp

  • New Member
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: What's a class ?
« Reply #5 on: Sun, Aug 14, 2011 »
Yeah, I guess I'm gonna do that. Even though I understood (kinda) what a class is thanks to 01010111 and Wing Eraser, there are a lot of other stuff I don't understand.

Thanks !