Submissions by Bobbo tagged luxe

I'm working on my weekly game which is tentatively titled Spaceship. You play as a... well.. spaceship who has to fly around avoiding the things trying to kill you and blasting them to pieces with your guns. The game is going to autofire at the closest enemy which leaves the player free to dodge and move around. I'm thinking the enemies will also leave collectables. Depending on how much time I have I might add additional weapons you can purchase and give the player the ability to customize the way they aim (closest enemy, fastest enemy, highest HP enemy, etc). Then I'll give the player the ability to equip multiple weapons with different firing requirements to deal with the different types of enemies (A standard canon that fires at closest enemy, a quick firing laser that targets the fastest enemy and a slow moving missile that targets the strongest of slowest enemy, for instance)

I started coding today. I was half way through coding my weapons when I realized what I had actually done was started to recreate a component system, which Luxe has built in. So I backtracked on that and started using the components. Then I realized that my main ship class I wrote to encapsulate a bunch of data was actually an Entity with children system, which Luxe also has built in. So I backed all that code out and started using the Entity system. So I learned a lot about the framework but unfortunately didn't get a lot done on the actual code.

Oh well.

I started porting my Mass Battle game over to Luxe from HaxeFlixel as another engine exercise. Coding the whole thing in an MCV architecture made most of the port simple. The game logic is set up and I'm close to where I left off in HaxeFlixel after only a half hour converting.

The problem is that I used a couple helper functions in HaxeFlixel that won't work the same in Luxe. I used a TileAtlas for all my images and Tiled to create the levels. Luxe has importers for both those things (I think...) but of course they are undocumented, as the engine is still in Alpha. So I've got to read through the code and figure it all out myself. I'm a little too tired this evening to start that.

So nothing to show, because it is a blank box.

So I'm getting closer to where I want to be with Luxe and in particular shaders. Working off of the great lesson here I got some dynamic lighting with normal maps working.

On a sad note, I think I'm going to break my One Game a Week streak since it is Friday and I haven't even started yet...

My journey with Luxe continues.

I got the parcels working and was able to import and display graphics now, so the placeholder graphics should disappear over the next day or two. I ran into some major headscratchers with importing textures and json files and having them be available to Luxe, but I figured them out after some frustration. My problems came with everything being loaded asynchronously. I thought that the Luxe ParcelLoader (which I thought was a preloader, but actually isn't) would hold the game until all the assets were finished loading but it doesn't. I had to add all my sprite and game initializations into a load_complete function and add if(sprite==null) return; to the top of my update() loop to prevent it from running before all the assets are loaded.

I wrote a pretty substantial blog post about it here.

Now that the cat is running in the game again I've cleared another major hurdle. Now once I get the remaining graphic assets in the game I'll be officially where I was at the end of last week when I switched the engine from HaxeFlixel. Actually, a little ahead because I have the collisions for the boxes and stuff working now and they weren't before. My last problem with the graphics is getting the sprite to display offset from the Shape that controls collisions. I'm sure it is a simple fix but I just haven't found it yet.

I'm starting to like Luxe. I still don't like it as much as HaxeFlixel, but I'm still fighting to learn it, so who knows. One thing that I do love about it so far is the way that it handles States.

Basically today I created a Finite State Machine to control the game states in Luxe. What is cool about how Luxe handles them is that I can switch between them easily, or I can enable them individually to have multiple states active at once. I'm going to use them to create modular behavior for entities that I can reuse. So for instance, I can create a SearchState where the entity will wander around trying to find the player and I can add that state to every entity in the game to give them all that ability.

The same states can be used to run the game logic too.

I wrote a whole long blog post about it here if you are interested.

Nico, that was one heck of a sales pitch...

Here we go. I'm learning Luxe. My goal this week is to port Catabalt into Luxe and have it running on HTML5 by the end of the week. Luxe is proving to have a really step learning curve because of the near complete lack of documentation, but its alpha and this is to be expected.

My initial impressions are mixed. I have mixed feelings about initializing objects through typedefs instead of constructors. I can see it being fast and nice, but until you learn all the options that you have it is slow and really easy to mess up. The only place I was able to find what options I could actually use are buried deep in the source code.

I'll admit that I almost gave up on this whole endeavor multiple times today, but I'm pressing on. The real reason that I'm pressing on? So I can use shaders.

Nico, I'm willing to give this a shot because I see where the benefits might be once it is actually ready. I think I'm willing to put time into learning it and maybe even contributing to the project if you can give me some quick, high level overviews about some things. So if you've got time for a couple questions:

  1. What is the design goals for scenes and states? I think a state is just a way of organizing code into convenient blocks but it doesn't actually affect what is loaded on the screen. The Scene is essentially a state for graphical elements. Is this correct, or am I way off base?
  2. Can you give me a quick overview of how collisions work? I see that I can make a bunch of checks with the functions in luxe.collisions.Collision but I haven't stumbled across how to create them. Do I attach them to a sprite? I'm assuming not in case I want to follow MCV practices. Do you normally tie the shapes to sprites, or move around the sprites to match up with shapes?
I'm not looking for you to fully document everything here for me. Just a quick, high level overview would save me a ton of time reading through code and trying to piece all this information together myself.