Author Topic: flixel-android 0.5  (Read 20385 times)

finalsin

  • Member
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Re: flixel-android 0.5
« Reply #20 on: Tue, Dec 18, 2012 »
Excellent. That's really no big deal - it's a very small problem (<0.1% of installs so far) and it can wait, I imagine I wouldn't have time to administer a fix right now anyhow.

I have another question, I'm afraid. If I don't want to use screen-stretching options for the game, is it possible to draw *anything* outside the bounds of the stage? I'd ideally like the gamepad to be at the edge of the screen no matter what aspect ratio we're playing on.

Please don't rush to reply, I know I keep asking things! I really appreciate it.

Wing Eraser

  • Contributor
  • ****
  • Posts: 477
  • Karma: +0/-0
  • ★★★★★
    • View Profile
    • Wing Eraser
Re: flixel-android 0.5
« Reply #21 on: Tue, Dec 18, 2012 »
So you want your game being stretched (making the santa claus even fatter) and let the gamepad stays normal, right?
Well, I need to hook the gamepad to a seperate FlxCamera to make this work. I don't know if this will work. Probably other objects will be drawn again on it. There is no option to ignore a specific camera (I thought). Probably in the next commit I'll have something for you.

No worries about the questions. We are really excited about your game. AFAIK your the first one that actually published game made with flixel-android.

finalsin

  • Member
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Re: flixel-android 0.5
« Reply #22 on: Tue, Dec 18, 2012 »
What I want is for the game to appear as it does, normal aspect ratio - kind of like here (https://play.google.com/store/apps/details?id=org.gba.pp&feature=nav_result#?t=W251bGwsMSwyLDNd). But I want the gamepad to extend into the black area. Right now it's constrained to be within the drawn game stage area. Moving it to the black area would be more comfortable, and would take up less screen space for players too.

I'll take a look at FlxCamera, thanks for the tip. Do let me know if you have any ideas.

I'm talking lots about flixel-android! It's mentioned in my paper, and I've also used it for some toy projects here: www.github.com/cutgarnetgames. I just used it for Ludum Dare too! I really like it.

The game's been getting some good press (e.g. http://arstechnica.com/gaming/2012/12/artificial-intelligence-project-builds-a-puzzling-present/) so hopefully people are coming to the site and learning about flixel-android too!

Wing Eraser

  • Contributor
  • ****
  • Posts: 477
  • Karma: +0/-0
  • ★★★★★
    • View Profile
    • Wing Eraser
Re: flixel-android 0.5
« Reply #23 on: Tue, Dec 18, 2012 »
Ok I get it. There's probably a very ugly solution for this.
The default camera should be stretched.
The first camera should draw all your game objects with the option SCALE_X
The 2nd camera should draw the game pad with the option SCALE_X.

This'd slow down your game, because the objects will be drawn on multiple cameras.

Wing Eraser

  • Contributor
  • ****
  • Posts: 477
  • Karma: +0/-0
  • ★★★★★
    • View Profile
    • Wing Eraser
Re: flixel-android 0.5
« Reply #24 on: Tue, Dec 18, 2012 »
Did you updated at least to r118? Thomas added a feature to scale cameras.

finalsin

  • Member
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Re: flixel-android 0.5
« Reply #25 on: Wed, Dec 19, 2012 »
Thanks a lot for this. I'll definitely try your solution and see if we get a performance hit. I could always make it an option people can choose between.

Not sure what revision I'm on (I stupidly am not checking out of SVN, I'm installing manually off a download) but I'll let you know. Hopefully I should get some time to work on it tomorrow.

moly

  • Member
  • **
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: flixel-android 0.5
« Reply #26 on: Thu, Dec 20, 2012 »
What I want is for the game to appear as it does, normal aspect ratio - kind of like here (https://play.google.com/store/apps/details?id=org.gba.pp&feature=nav_result#?t=W251bGwsMSwyLDNd). But I want the gamepad to extend into the black area. Right now it's constrained to be within the drawn game stage area. Moving it to the black area would be more comfortable, and would take up less screen space for players too.

I think the easiest way to do this right now is to use scrolling. In your main class set the default scalemode to FILL_X:

Code: [Select]
public TiledMap2Demo()
{
    super(320, 240, PlayState.class, 2, 40, 40, false, FlxCamera.FILL_X);
}

Now in the PlayState, you need to set up your camera like this:

Code: [Select]
private FlxGamePad _pad;

@Override
public void create()
{
    //Background
    FlxG.setBgColor(0xffacbcd7);

    FlxG.width = FlxG.camera.viewportWidth;

    //Scroll the camera to the centre of the screen
    FlxG.camera.scroll.x = -(FlxG.width - FlxG.camera.width) / 2;

    //Set the cameras width to the screen width
    FlxG.camera.width = FlxG.width;

    //Create gamepad and set it to ignore the camera scroll
    pad = new FlxGamePad(FlxGamePad.FULL, FlxGamePad.A_B);
    pad.setAll("scrollFactor", new FlxPoint(0,0));

    //Optional: set FlxG.width back to the original game width if you need to
    FlxG.width = 320;

    add(_level);
    add(_pad);
}

Here's how it looks in the collision demo:



I'm going to work on fixing it so that you don't need to mess with FlxG.width, but this should work for now.

finalsin

  • Member
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Re: flixel-android 0.5
« Reply #27 on: Sat, Dec 22, 2012 »
Thanks so much for the help, guys! I am struggling to find the time to push the update out before Christmas but either way I will get around to implementing it. I really appreciate this - I'll be using the library more in 2013 for bigger projects!

Jeff

  • Active Member
  • ***
  • Posts: 127
  • Karma: +0/-0
    • View Profile
    • Entertainment Evolution
Re: flixel-android 0.5
« Reply #28 on: Wed, Dec 26, 2012 »
How does this relate to HaxeFlixel? That should work for iOS at the same time, so that should at least be a perk for that. How about otherwise?
Please give me feedback for my latest game in progress:
Blog: Entertainment Evolution

Wing Eraser

  • Contributor
  • ****
  • Posts: 477
  • Karma: +0/-0
  • ★★★★★
    • View Profile
    • Wing Eraser
Re: flixel-android 0.5
« Reply #29 on: Wed, Dec 26, 2012 »
How does this relate to HaxeFlixel? That should work for iOS at the same time, so that should at least be a perk for that. How about otherwise?

flixel-android currently support Desktop and Android. The rendering is done by libGDX and they are currently working on iOS support. Once they release it, we will add that platform to our project.
If you want to support iOS now (and dislike Java), you're better off using HaxeFlixel. I can't tell about the differents in performance. The performance of flixel-android is pretty good as far I know.

Plugins: they got far more plugins. Most plugins are ported from the contributors of flixel-as3.

curzonbar

  • New Member
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: flixel-android 0.5
« Reply #30 on: Tue, Jan 8, 2013 »
This port is really cool. I'm really glad that you are working on this. Good work.

I might be doing this wrong, but I have noticed something... My game switches states quite a lot, but there seems to be quite a lag in switching from one to another new state. It's only noticeable on the Android device, not in eclipse.

eg
Code: [Select]
FlxG.switchState(new GamePlayState());
The states are very light code-wise.

Any ideas on how I could speed that up?

Wing Eraser

  • Contributor
  • ****
  • Posts: 477
  • Karma: +0/-0
  • ★★★★★
    • View Profile
    • Wing Eraser
Re: flixel-android 0.5
« Reply #31 on: Wed, Jan 9, 2013 »
This port is really cool. I'm really glad that you are working on this. Good work.

I might be doing this wrong, but I have noticed something... My game switches states quite a lot, but there seems to be quite a lag in switching from one to another new state. It's only noticeable on the Android device, not in eclipse.

eg
Code: [Select]
FlxG.switchState(new GamePlayState());
The states are very light code-wise.

Any ideas on how I could speed that up?

Android devices aren't that fast as a desktop. Welcome to the world of mobile. When you do a switchstate, the old state will be destroyed and garbage collector (should) be kicked in. Creating a new state also takes time.

Options to solve this.
1. I don't know what kind of game you're creating that needs the swap states a lot. You can put the states in a stack. I don't recommend it to use it in large states, because it will consume to much memory.

2. It can't do any harm to let the user know the game is loading just before you call FlxG::switchState().

3. Create groups and render those when need it and freeze the rest.

To be at better service I need a little more info what those states are and why you need to switch a lot.

finalsin

  • Member
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Re: flixel-android 0.5
« Reply #32 on: Mon, Jan 14, 2013 »
Hey Wing and the f-a team!

I just wanted to apologise for going dark for the last few weeks. I really appreciate all the help I got in December from you guys - I couldn't have done it all without you. Unfortunately work has dragged me in another direction temporarily and I am spending January filling in exciting forms... >_>

I just wanted to let you know of a few things. First, I talked about my game and flixel-android on Reddit, and it got a great reception!

http://www.reddit.com/r/gamedev/comments/16hqi7/the_code_and_art_for_my_very_simple/
http://www.reddit.com/r/OneGameAMonth/comments/16hqy3/for_any_flixel_users_wanting_to_get_into_java_my/

Second, if you go to those links you'll see I've open sourced two small games, and my Christmas game, including the artwork. The license is entirely open, for re-use, commercial use, modification, etc. without attribution. Please feel free to chop up the project as you wish if any of it is helpful.

I'll be in touch again in the future but for now, thank you so much.

Mike

Wing Eraser

  • Contributor
  • ****
  • Posts: 477
  • Karma: +0/-0
  • ★★★★★
    • View Profile
    • Wing Eraser
Re: flixel-android 0.5
« Reply #33 on: Mon, Jan 14, 2013 »
Wow, it seems people are excited about libGDX and flixel-android. Thanks for making nice words at reddit.
We look forward to your games in the future.

finalsin

  • Member
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Re: flixel-android 0.5
« Reply #34 on: Fri, May 3, 2013 »
Just wanted to let you know I'm still loving flixel-android. I made my Ludum Dare game in it: http://www.ludumdare.com/compo/ludum-dare-26/?action=preview&uid=12174

I wondered what the status of HTML5 compatibility was? I seem to remember it was an issue higher up in LibGDX itself that was causing the problem. Is that still the case?

Wing Eraser

  • Contributor
  • ****
  • Posts: 477
  • Karma: +0/-0
  • ★★★★★
    • View Profile
    • Wing Eraser
Re: flixel-android 0.5
« Reply #35 on: Sat, May 11, 2013 »
Just wanted to let you know I'm still loving flixel-android. I made my Ludum Dare game in it: http://www.ludumdare.com/compo/ludum-dare-26/?action=preview&uid=12174

I wondered what the status of HTML5 compatibility was? I seem to remember it was an issue higher up in LibGDX itself that was causing the problem. Is that still the case?

Hmmm I should visit the forum regularly....
Cool, another game from you. flixel-gdx has currently no html5 support. libgdx is planning to add a new Reflection API in the next version or they have plans for Dart compiler.  We'll need to wait for them.

Looking forward to your projects.