Rocket-propelled Asteroid
1,585
0
Advertisement
There were a number of issues, so I talked with Laura about how to organize everything and it seemed best to re-do a number of the major systems. That, and I read up more on Pyglet -- I take back what I said about the documentation being worse than Pygame; it's better, perhaps, but there are less tutorials and secondary information sources (but then so much overlaps with OpenGL itself, so perhaps not). Anyway, it's a recently released project, but I'm finding that is smooths out many of the rough edges of OpenGL very nicely.
"Actions" and "States" are no longer separate, generally. All actions are now handled through the .update() call attached to States, so for example the State Physics.update() is equivalent to the old Move action. Sprites are now held in a Renderable state so that many sprites can be attached to one object, and the update call handles animation (though animated sprites are not implemented yet). The action queue is still around, and it might be used by special cases, but I'm not sure about that yet.
The rendering was also overhauled to account for all these changes as well.
So have a look.
This:
Makes this:

Yeah, I haven't implemented a system to do all the enginepoints on a ship sprite, so the its the asteroid which gets a rocket trail to show off the particle emitter.
And I must admit that the starfield is a bit hackish, but it should take only a little work to get multiple layers working properly and scrolling by at different ratios. It'd be nice to get these changing depending on location, too.
It looks like the final push on Besome Games' Linx0r is happening, so I'm going to be doing a bunch of final graphics for that this week. We'll see what I've got time for on Oort, but at least I'm feeling better about its direction.
Component System
"Actions" and "States" are no longer separate, generally. All actions are now handled through the .update() call attached to States, so for example the State Physics.update() is equivalent to the old Move action. Sprites are now held in a Renderable state so that many sprites can be attached to one object, and the update call handles animation (though animated sprites are not implemented yet). The action queue is still around, and it might be used by special cases, but I'm not sure about that yet.
The rendering was also overhauled to account for all these changes as well.
So have a look.
This:
asteroid = Entity()asteroid.addStateByName( 'renderable' )asteroid.getStateByName( 'renderable' ).addSprite( 'testAsteroid03' ) asteroid.addStateByName( 'particleemitter' )asteroid.getStateByName( 'particleemitter' ).imbue( asteroid ) asteroid.addStateByName( 'physics' )asteroid.getStateByName( 'physics' ).rotation = 1.0asteroid.getStateByName( 'physics' ).vectors = (0.5,1.0)asteroid.getStateByName( 'physics' ).coords = (512.0,512.0 )self.addEntity( asteroid )Makes this:

Yeah, I haven't implemented a system to do all the enginepoints on a ship sprite, so the its the asteroid which gets a rocket trail to show off the particle emitter.
And I must admit that the starfield is a bit hackish, but it should take only a little work to get multiple layers working properly and scrolling by at different ratios. It'd be nice to get these changing depending on location, too.
In other news...
It looks like the final push on Besome Games' Linx0r is happening, so I'm going to be doing a bunch of final graphics for that this week. We'll see what I've got time for on Oort, but at least I'm feeling better about its direction.
Advertisement
Advertisement
Advertisement
Discussion