Default Package? (Axelite Basic)

Discuss official tutorials here.

Default Package? (Axelite Basic)

Postby 7vn » Thu May 23, 2013 2:06 pm

"Now that we know how to work with the state system, let's create our GameState! We're going to start out with the absolute basics. Start by creating GameState.as in your default package, and filling it with the following:"

What is my default package? My src folder?

"Now, let's update our main file to tell the game to jump right into the GameState when the game begins. Open AxeliteBasic.as and fill it with the following code:"

Is our main file, Main.as created by New Project from within FD? Or is our main file AxeliteBasic.as that we create?

Currently, I haven't touched Main.as created by FD, I just added files AxeliteBasic.as, GameState.as, Resource.as into the src folder. When I try to run it though, the console doesn't output "GameState Created" but a window with a white background does pop up.
7vn
Corporal
 
Posts: 10
Joined: Thu May 23, 2013 1:53 pm

Re: Default Package? (Axelite Basic)

Postby Arkeus » Thu May 23, 2013 4:37 pm

7vn wrote:What is my default package? My src folder?


Yep.

7vn wrote:Is our main file, Main.as created by New Project from within FD? Or is our main file AxeliteBasic.as that we create?

Currently, I haven't touched Main.as created by FD, I just added files AxeliteBasic.as, GameState.as, Resource.as into the src folder. When I try to run it though, the console doesn't output "GameState Created" but a window with a white background does pop up.


I believe the AxeliteBasic was created using FlashBuilder, which means some things will be slightly different. I'd read through the flash develop tutorial (again if you already have) to get an idea how the main class works:

http://axgl.org/tutorials.php?id=flash- ... ello-world

In FlashDevelop it creates Main.as instead of AxeliteBasic.as. So you should rename your Main.as to AxeliteBasic.as and put your AxeliteBasic.as logic in there. Alternatively, delete Main.as if you already have AxeliteBasic.as, but you need to set AxeliteBasic.as as your main class manually since you deleted the main class. I think you just right click and click "always compile" or "set as main" or something (I don't use FD anymore so I don't remember off the top of my head).

Right now I think you have your main game hook in Axelite.as, but since FlashDevelop has Main.as set as the main class, it's executing that and never getting to your code, since your main.as is still the default.
Image
User avatar
Arkeus
Site Admin
 
Posts: 363
Joined: Mon Mar 26, 2012 12:43 am

Re: Default Package? (Axelite Basic)

Postby 7vn » Fri May 24, 2013 4:22 pm

Thanks a lot. : )

I finished the tutorial and started Essential Actionscript 3.0. Looking forward to making a game with your library, looks very useful.
7vn
Corporal
 
Posts: 10
Joined: Thu May 23, 2013 1:53 pm


Return to Official Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest

cron