Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - OmegaStorm

Pages: [1] 2
1
http://www.omegastormproductions.com/uber-flash/flixel-tutorials/hello-world-test

Take a look at section 2 of this tutorial explaining how to do both methods. As to the reason why I recommend method 1; it's so Flixel stays with your project should you upload the source somewhere (Github for example).

2
Silly me. I should probably address your original issue. You are right to assume that your text is being added during each update; 30 times a second for 5 seconds. A simple solution would be to add a Boolean that switches from false to true when the counter reach zero.

Code: [Select]
if (_numOfAliens >= 100)
{
     _counter -= FlxG.elapsed;
     _counter2 -= FlxG.elapsed;

     if (_counter <= 0 && _counterOneComplete == false)
     {
          _winnerText = new FlxText(0, (FlxG.width / 2) - 150, FlxG.width, "Level complete!")
         
          _winnerText.setFormat(null,48,0xFFFFFFFF,"center")
  this.add(_winnerText);

          _counterOneCompleted = true;
     }

     if (_counter2 <= 0 && _counterTwoComplete == false)
     {
          _counterTwoComplete = true;
          FlxG.state = new PlayState();
     }
}

Just declare them like you normally would and don't forget to have them reset to false when the state restarts.

3
Code: [Select]
if (x < (FlxG.width - FlxG.width) - 50)
 {
   kill(); // Kills the alien if it is not destroyed and moves off the screen
 }

Add this to the alien update (before super.update)to kill them if they leave the screen. I have it in my copy, I must have forgot to mention it in my tutorial. I'm sure writing it after the fact was the cause.

You are right though. Neither mine nor Andreas' tutorial are build with performance in mind (lol at all those Bullet = new Bullets). I was still new to Flixel (and AS3) at the time and was simply inspired to continue coding on it, sort of like you. As long as it worked, I was happy.

I'm going to be writing a new tutorial that's more optimized than that one soon. And I'll be writing it as I make it, as to not forget something this time.

Object Pools are your friend.

4
help / Re: How to bounce enemy back when hit?
« on: Tue, Feb 15, 2011 »
You could always use a timer and override the velocity for a certain duration.

5
games / Re: Looking for feedback
« on: Thu, Oct 21, 2010 »
I really like the use of endurance. I totally had a Shadow of the Colossus flashback when climbing the "endless" wall and the whole fruit of youth thing. I thought it would take my endurance away like the fruit in the secret garden.

I encountered some bugs. After collecting all the gems, the shaft of light is broken in two and the only way to hop up to the other part of it is to use the chute just before crossing up into the next screen, which itself is another bug: the parachute inherits the upward velocity of the light shaft for a few seconds after leaving it.

Also, when the game ends and you reload your save it immediately, the endurance bar isn't visible and the stun from falling doesn't go away. Only refreshing the game fixed it.

6
help / Re: my preloader.as throws an error.
« on: Thu, Oct 21, 2010 »
Set Main.as to always compile.

Main.as
Code: [Select]
package 
{
    import org.flixel.*; 
    [SWF(width="640", height="480", backgroundColor="#000000")]
    [Frame(factoryClass="Preloader")]
    public class Main extends FlxGame
    {
        public function Main():void
        {
            super(640, 480, YourState, 1)
        } 

    }
}

Preloader.as
Code: [Select]
package
{
import org.flixel.FlxPreloader;

public class Preloader extends FlxPreloader
{
public function Preloader()
{
className = "Main";
super();
}
}
}

7
super(320,240,PlayState, 2)

I notice you don't have your zoom level set here. What other code did you add/change so far?

8
It works as far as I know. What are the errors?

9
loadGraphic(CharImg, true, true);

You left out the dimensions of the sprite when loading it.

For example:

loadGraphic(CharImg, true, true, 16, 16);

10
help / Re: How can I make a bullet array?
« on: Mon, Oct 18, 2010 »
Take a look at this tutorial that shows you how to create a basic defender style shoot 'em up. It'll cover creating a player class, enemy class, and bullet class, how to add them to groups and the stage, and collision between them.

http://www.creativeapplications.net/flash/flixel-2-tutorial-flash-tutorials-games/

It helped me out quite a bit when I was getting started. I've expanded upon it a bit by adding different weapons, powerups, and a heads up display in my own 2 part tutorial.

http://www.omegastormproductions.com/uber-flash/flixel-2-tutorial-extended

12
help / Re: How can I make a bullet array?
« on: Mon, Oct 18, 2010 »
The easiest way would be to add the bullets to a FlxGroup and the enemies to a FlxGroup and check to see if the two groups collide/overlap.

EDIT: What initials said. XD

13
help / Re: Hello World file size.
« on: Mon, Oct 18, 2010 »
I looked back through my files and found mine and it's 112 KB. It's probably the default Flixel preloader and stuff. I wouldn't worry about it.

14
help / Re: I Need Help With Flixel Badly.
« on: Mon, Oct 18, 2010 »
You can find Mode here: http://github.com/AdamAtomic/Mode

Here's a tutorial for a defender style game: http://www.creativeapplications.net/flash/flixel-2-tutorial-flash-tutorials-games/ and then my tutorial built directly off it showing how to add different weapons, powerups, and HUD: http://www.omegastormproductions.com/uber-flash/flixel-2-tutorial-extended

15
Good to have all these in one place. This should totally be a sticky.

16
help / Re: Teleport player to location of FlxObject
« on: Sat, Oct 16, 2010 »
Maybe just " teleport(_teleball.getBallLocation()); " would work

17
help / Re: Teleport player to location of FlxObject
« on: Sat, Oct 16, 2010 »
I think that's a lower case L, not a one. Did you run a trace to see if the function is even firing?

18
help / Re: I Need Help With Flixel Badly.
« on: Fri, Oct 15, 2010 »
After I got my feet wet with tutorials, I learned more from searching these forums then anywhere else. Try using the search function for something specific and if that doesn't yield results, don't be afraid to ask. We're all friends here.

That said, here's a tutorial for installing on getting everything setup right: http://flashgamedojo.com/wiki/index.php?title=Installing_FlashDevelop

Here's a tutorial for the FlashDevelop Hello World: http://flashgamedojo.com/wiki/index.php?title=Hello_World_-_FlashDevelop_%28Flixel%29

19
help / Re: Flixel Copyright?
« on: Thu, Oct 14, 2010 »
Flixel is released under the MIT license (http://en.wikipedia.org/wiki/MIT_License), so yeah, it's not a problem.

20
help / Re: Explosions and animations.
« on: Tue, Oct 12, 2010 »
Very Nice, SysOp. Nice to learn new, overly awesome techniques.

Pages: [1] 2