Author Topic: Basic Game Tutorial  (Read 75998 times)

bobbybaker82

  • Active Member
  • ***
  • Posts: 155
  • Karma: +0/-0
    • View Profile
Re: Basic Game Tutorial
« Reply #100 on: Mon, Nov 16, 2009 »
100th reply!!

I set up a new blog covering your tutorial and all the Flx classes.  Check it out if you like:

http://barnabybyrne.blogspot.com/2009/11/running-through-basic-game-tutorial-on.html

Badger
 8)
Hm.
So, you took all the stuff that darthlupi and I wrote for this tutorial, and copy/pasted it to your blog without checking to see if it was alright?
Interesting.


Don't you think it would have been easier to just take 2 seconds and look at his blog before jumping down his throat?  :-\


bobbybaker82

  • Active Member
  • ***
  • Posts: 155
  • Karma: +0/-0
    • View Profile
Re: Basic Game Tutorial
« Reply #101 on: Mon, Nov 16, 2009 »
Let's just hope it was a misunderstanding :) Happens to the best of us. :)

SeiferTim

  • Contributor
  • ****
  • Posts: 253
  • Karma: +0/-0
    • View Profile
    • Tim's World
Re: Basic Game Tutorial
« Reply #102 on: Mon, Nov 16, 2009 »
Badger: Thank you for removing the content. The thought that you were intending to use this content for financial gain was only a small fraction of the reason why I was not happy with your approach... there's a whole list of issues that immediately sprang to mind while I was skimming over the post on your blog, but they irrellevant now.

I am flattered you found our tutorial useful. The biggest piece of advice I can give you for the future would be to just ask. either in a PM or in this thread or whatever... I would still have said "no", but we might have discussed some alternatives, and at the very least all this forumdrama would have been avoided...

Good luck on your site - continue to write your own articles, and I'll read them.

PlayOrDie

  • Active Member
  • ***
  • Posts: 151
  • Karma: +0/-0
  • Game Over
    • View Profile
Re: Basic Game Tutorial
« Reply #103 on: Mon, Nov 16, 2009 »
No problem, I am sorry if it came across in the wrong way.  There was an element of me wanting to suprise you (in a good way), but also a little hesitance I guess as I was not sure how you would feel about it.

Anyway I meant well, and seeing it from your point of view, I can totally understand how it must have been alarming to see your own tutorial headings and a bunch of adsense on there.

And it is only fair that I remove all your code etc. which I have absolutely done.

I'm sure we've all considered the possibility of making money out of blogs, well although I have thought about it, I quite honestly don't expect to.  The adsense on there is really just delusions of grandeur, though I do feel that I have the ability to do technical writing of sorts.

By the way I meant what I said, your tutorial really is good and has helped a lot already.  I never wanted to do more than explain the logic behind the code in it, but that's not really for me to do I guess..however everything that I wanted to say applies to Mode as well, like changing state, and examining all the clsases in it, so I am dissecting that instead now.  Thanks for saying that you will take a look as I try and add to it.
« Last Edit: Tue, Nov 17, 2009 by Badger Manf. »
Make it work reliably and fast.
Donald Lebeau - Gauntlet

increpare

  • Member
  • **
  • Posts: 42
  • Karma: +0/-0
    • View Profile
Re: Basic Game Tutorial
« Reply #104 on: Mon, Nov 16, 2009 »
hugs all round  :)

PlayOrDie

  • Active Member
  • ***
  • Posts: 151
  • Karma: +0/-0
  • Game Over
    • View Profile
Re: Basic Game Tutorial
« Reply #105 on: Mon, Nov 16, 2009 »
Yeah my approach was wrong, and there was no real need to do a tutorial on a well explained tutorial. Lol. I do understand stuff better now, so good times.  :)
Make it work reliably and fast.
Donald Lebeau - Gauntlet

BullitSpeed

  • Contributor
  • ****
  • Posts: 264
  • Karma: +0/-0
    • View Profile
    • My Website!
Re: Basic Game Tutorial
« Reply #106 on: Wed, Nov 18, 2009 »
Just finished the tutorial.  Infinite thanks for this.  It helped me gain a beginning grasp on Flixel far more quickly.  Next, I plan on really digging into the Flixel classes now to try to understand why they do what they do in the tutorial source.  And then I've got to check out BFlixel...  A lot to take in, but it's going fast.

I saw someone had mentioned they'd like to see a tutorial chapter for setting up multiple levels.  I'd definitely like to learn that too.  Between all of this and Mode, grasping Flixel is looking very promising here (I'm relatively new to AS3 Flash development in Flex Builder 3, but am learning fast and enjoying it a lot).

Cheers
 :)

PlayOrDie

  • Active Member
  • ***
  • Posts: 151
  • Karma: +0/-0
  • Game Over
    • View Profile
Re: Basic Game Tutorial
« Reply #107 on: Wed, Nov 18, 2009 »
Just a thought, as I am planning how multiple levels can be done too, would it not be possible to set a variable currentlevel:uint=1 when you first start playing, then in your playstate.as you can tamper with:

_map = new FlxTilemap(new DataMap, ImgTiles, 12);
          
To be more like

if(currentlevel==1)
_map = new FlxTilemap(new DataMap1, ImgTiles, 12);
          
else if(currentlevel==2)
_map = new FlxTilemap(new DataMap2, ImgTiles, 12);

etc...

And also create a LevelProgressionState.as file which would increase the current level.  It would be the same as MenuState.as except "level complete prepare for next level" instead of your title screen.
          
[EDIT] I will be performing this check in 'PlayStateTiles.as' as I am using Flan now.
« Last Edit: Fri, Nov 20, 2009 by Badger Manf. »
Make it work reliably and fast.
Donald Lebeau - Gauntlet

iMrEuphony

  • Guest
Re: Basic Game Tutorial
« Reply #108 on: Sun, Nov 22, 2009 »
Hey all,

First off thanks for the great tutorial.

I've had flex/flixel installed for about an hour so apologies if I've done something silly.
I'm having trouble with the code example below:

Quote from: SeiferTim
     
Code: [Select]
override public function update():void
              {
                  if (FlxG.kA)
                  {
                      FlxG.flash(0xffffffff, 0.75);
                      FlxG.fade(0xff000000, 1, onFade);
                  }
                  
                  super.update();
              }

First off Flx.kA doesn't seem to exist for me.

Quote from: Flex Builder 3
Access of possibly undefined property kA through a reference with static type Class.

And secondly, FlxG.flash is taking on the colour passed to Flx.fade.

As in, for the above code, it would flash black, and then fades to black (granted I can't see this bit, since it's already black, but I'm pretty sure that's whats happening).

Any ideas? All help would be appreciated.

Cheers,
euph

Socapex

  • Active Member
  • ***
  • Posts: 156
  • Karma: +0/-0
    • View Profile
Re: Basic Game Tutorial
« Reply #109 on: Sun, Nov 22, 2009 »
Hey guys, I just wanted to say thanks for porting the tut on the wiki. I think it's going to be way more user friendly there. Thanks again!
Free cake every day at #flixel on irc.freenode.net.
Use your favorite IRC client or  http://webchat.freenode.net/

Keldorn

  • Guest
Re: Basic Game Tutorial
« Reply #110 on: Sat, Nov 28, 2009 »
First off Flx.kA doesn't seem to exist for me.

It Appears to be now  FlxG.Keys   which then you can set a certain key say. the "a" key
FlxG.keys.A

I could be wrong though, I only been using Flixel for about 1 hour.
 But I had this trouble myself doing this tutorial.
http://active.tutsplus.com/tutorials/screencasts/conquer-the-universe-with-actionscript-3-0-and-the-flixel-game-engine-part-1/

Appears many of the tutorials out there are using outdated methods.
« Last Edit: Sat, Nov 28, 2009 by Keldorn »

Keldorn

  • Guest
Re: Basic Game Tutorial
« Reply #111 on: Sat, Nov 28, 2009 »
Hi, like above FlxG.ka is now FlxG.keys,   Can anyone say what is the alternative for FlxG.justPressed?

NineDice

  • Guest
Re: Basic Game Tutorial
« Reply #112 on: Sat, Nov 28, 2009 »
Hmm, perhaps I'm missing something here but I cannot seem to find the fabled Preloader.as.

It's been mentioned it "comes with Flixel". Anyone care to clarify?

cai

  • Contributor
  • ****
  • Posts: 465
  • Karma: +0/-0
  • the illest of villains
    • View Profile
    • Brandon Cash
Re: Basic Game Tutorial
« Reply #113 on: Sun, Nov 29, 2009 »
Hmm, perhaps I'm missing something here but I cannot seem to find the fabled Preloader.as.

It's been mentioned it "comes with Flixel". Anyone care to clarify?
It seems that it is not included with Flixel on github, probably since the preloader is really part of the game, not necessarily flixel.  That said, it is available with the sample games.  Here is the Preloader.as from FlxTeroids.
Follow me on Twitter | Come join us at #flixel on irc.freenode.net!

Keldorn

  • Guest
Re: Basic Game Tutorial
« Reply #114 on: Sun, Nov 29, 2009 »
I was slamming my head last night trying to figure this out ( well not literally). If anyone else has this problem, maby this will help.   When I complied the game after creating the playstate.as and the player, the player would appear and then fall off the screen and the map would not appear.
Some of the x, y variables were incorrect in the tutorial.

Code: [Select]
FlxG.followBounds(1,1,640-1,480-1);
Should of been,
Code: [Select]
            FlxG.followBounds(1,1,320-1,240-1);
Code: [Select]
_p = new Player(48, 448);That would make the player appear out of the bounds, hence whey I would see no map and the player just falling off the streen, I change to
Code: [Select]
_p = new Player(16, 32);
So the player would appear in the corner of the map.

btw the tutorial works good so far, with the new flixel, is just that FlxG.KA   needs to be now,
FlxG.keys.X    and

Flxg.justpressed()  -> FlxG.keys.justpressed

fedekun

  • Guest
Re: Basic Game Tutorial
« Reply #115 on: Wed, Dec 2, 2009 »
I'm having a problem with the method 'collideArray2', it cant find it, has it changed name or something?

gummifer

  • Member
  • **
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: Basic Game Tutorial
« Reply #116 on: Thu, Dec 3, 2009 »
I'm having a problem with the method 'collideArray2', it cant find it, has it changed name or something?

I had that problem too. In the end I used a for-loop to work around it. Like this:

for (var j:int = 0; j < playersStars.length;++j) {
   map.collide(playersStars[j]);
}

It seems to work. Though I'm experiencing a bug that sometimes makes the stars explode into sparks before throw them away. Like if they collide with the ground you're standing on or something.

Dabo

  • Guest
Re: Basic Game Tutorial
« Reply #117 on: Fri, Dec 4, 2009 »
btw the tutorial works good so far, with the new flixel, is just that FlxG.KA   needs to be now,
FlxG.keys.X    and

Flxg.justpressed()  -> FlxG.keys.justpressed

FlxG.keys.X works fine for me, but justPressed needs a string for an argument, right? I have:

Code: [Select]
FlxG.keys.justPressed("x")
and I'm getting the error

Code: [Select]
TypeError: Error #1010: A term is undefined and has no properties.
And then there's a bunch of stuff pointing to the problem, which is the justPressed deal-i-o. Any reason why this is happening?


Rybar

  • Contributor
  • ****
  • Posts: 279
  • Karma: +0/-0
    • View Profile
Re: Basic Game Tutorial
« Reply #118 on: Fri, Dec 4, 2009 »
Code: [Select]
(FlxG.keys.justPressed("X"))  //Capital X
x (lowercase) isn't defined in FlxKeyboard.

-Ryan

Tycho

  • Guest
Re: Basic Game Tutorial
« Reply #119 on: Sat, Dec 5, 2009 »
Few questions.

1. I don't have the Preloader file when I make an AS3 project. Do I have to make it myself?

2. For step 10, how do you make the class an extension of FlxGame? I don't think you explained it. And do we make Preloader.as the extension or Tutorial.as?