Item posted by Layla Marchant <onpon4> on Sat 28 Jun 2014 10:39:53 PM UTC.

Boy do I have a big release today: version 0.10.0 of the SGE. You can find it on the download page:



http://stellarengine.nongnu.org/download.html



This release adds and changes quite a bit. Here are the highlights:



sge.Sprite now has a new method called "draw_erase". As the name implies, it erases (clears) a particular rectangular area of the sprite.

sge.StellarClass.detects_collisions has been removed. It has been replaced with the more well-defined sge.StellarClass.checks_collisions and sge.StellarClass.tangible. The old detects_collisions attribute actually behaved mostly similarly to the new checks_collisions attribute, so objects that don't need to be involved in any collision detection at all can leave less of a footprint now.

It is now possible to disable collision events entirely via sge.Game.collision_events_enabled. Some games simply don't need it, and setting collision_events_enabled to False is a lot easier than setting checks_collisions to False for every single object. Incidentally, the Pygame SGE gets a tiny extra performance boost by disabling collision events rather than disabling collision checks for every object.

Old functions that were in the "sge" namespace have been moved to their own modules: the keyboard module, the mouse module, and the joystick module. The functions that showed modal dialogs have been removed altogether; see below for an explanation.

A system of "input events", similar to Pygame's event system, has been added. This is not meant to be used normally; it is used internally by the main loop to call event methods. Its purpose is to allow custom loops (see the next bullet point). The system is mostly contained within the new sge.input module.

Three methods have been added to make extra loops similar to the main game loop possible: sge.Game.pump_input, sge.Game.regulate_speed, and sge.Game.refresh. "Input events" are used alongside these in order to receive input from the user and handle it appropriately. This is now used for the Pygame SGE's pause screen (which looks and behaves better as a result).

It is now possible to "lock" and "unlock" sprites for drawing via the new sge.Sprite.draw_lock and sge.Sprite.draw_unlock methods. What this does is allow the implementation to not perform updates it would normally perform automatically, making continuous drawing much faster.

It is now possible to "refresh" joysticks via sge.joystick.refresh, allowing the game to learn about newly plugged in joysticks without being restarted.

Several bugs in the Pygame SGE have been fixed.

See the WHATSNEW files for a more complete list.



One of the big changes made was to get rid of all the functions that were loaded into the "sge" namespace and move them off the other modules. You will notice, though, that sge.show_message and sge.get_text_entry don't have replacements; they were just removed. The reason for this is I'm developing a replacement for them as a part of a set of extra modules called xSGE. More about that later (when xSGE is actually released).



In the meantime, if you need to get basic input from the user (like confirming whether the user wants to quit the game), I suggest asking for a key press (like the old "press Y for yes or N for no" method). This is much easier to do now that you can build your own loops.

