Tuesday, 9 June 2009

Game engine version 016u7 update

Added the following functions for PC only systems which might be quite useful so didn't do a full intermediate update.
---------------------------
FileManager
----------------------------
OpenFilePCImmediate - added, Opens a PC based xml file from any location.

SaveFilePCImmediate - added, Saves a PC based xml file to any location.

Game Engine version 016u7

----------------------------
Sprite
----------------------------
ReleaseQuickAnimation - added, allow you to remove a quick animation before it has finished going back to previous state

Did some optimising of the sprite Update code(won't have much effect on PC side but hopefully does on 360 side). The whole engine is in need of a total re-write to make use of static allocation, but that won't happen until I build the next version over Summer.
----------------------------
PadHelper - new class added
----------------------------
This allows more flexible support for pad button handling.It automatically keeps track of pad state, so you can track accuratelythe status of all buttons on the gamepad. You can still use you're existing code for gamepad handling and timers but if you need easy access to the following functions, you can with just 2 simplemodifications to you're input code.

Status - added, this updates the gamepad status (tracking the history) mimics the GamePad.GetState method currently used.

Pressed - added, this method checks to see if a button not previously pressed has just been pressed. Using this will stop buttons repeating without the use of a timer, as it will only be true if the button was released before being pressed.

Released - added, this method checks to see if a button previously held has just been released. Using this will let you react to a button being let go for instance charging an energy bar (or the jump angle in track & field).

Held - added, this method checks to see if a button held previously is still being held.

----------------------------
KeyHelper - new class added
----------------------------
This allows more flexible support for keyboard handling.It automatically keeps track of keyboard state, so you can track accuratelythe status of all keys in the keyboard. You can still use you're existing code for keyboard handling and timers but if you need easy access to the following functions you can with just 2 simplemodifications to you're input code.

Status - added, this updates the keyboard status (tracking the history) mimics the Keyboard.GetState method currently used.

Pressed - added, this method checks to see if a key not previously pressed has just been pressed. Using this will stop keys repeating without the use of a timer, as it will only be true if the key was released before being pressed.

Released - added, this method checks to see if a key previously held has just been released. Using this will let you react to a key being let go for instance charging an energy bar (or the jump angle in track & field).

Held - added, this method checks to see if a key held previously is still being held.

----------------------------
TrackManager
----------------------------
SpecifyEndTrackHandler - added, this allows you to call an update routine when a sprite reaches the end of a track, so you can take some action

RemoveEndTrackHandler - added, this removes any end of track handler

----------------------------
Menu
----------------------------
reference to EngineManager -added, this enables Show and Hide to work without going through the MenuManager (gameMenus)

Show(), Hide() - added, this can be directly used with a menu object

e.g. optionsMenu.Show();

----------------------------
MenuManager
----------------------------
AddMenu - altered, to pass a reference to the EngineManager to each menu. The MenuManager is now just responsible for updating all the menus, everything else is now the responsiblity of the menus directly.

Monday, 8 June 2009

XNA Game Engine version 016u6

I have probably missed some other fixes and additions here (did a lot of messing)

----------------------------
Sprite
----------------------------
Pause() - added, this causes the update for a sprite to be suspended, this can be used during loss of life to stop certain sprites attacking/moving etc...

Resume() - added, this causes a sprite to continue updating.

There will be timer related problems due to pausing, these are the same issues that normal timers currently suffer from when paused and then resumed. I will come up with a solution to this at some point but it is not a major problem.

For examples of pausing sprite types look at the Space invaders code when a life is lost.

Collisions:PauseAllInvaders()
GamePlay:StopInvaders()
TimerEvents:ResumeWalk()

----------------------------
EngineManager
----------------------------

SpriteFrameSingleWhitePixel() - added, adds a frame to a given sprite containing a single white pixel, this can be coloured or enlarged.

SpriteFrameSingleTransparentPixel() - added, adds a frame to a given sprite containing a single transparent pixel, used for dummy sprites mainly for applying textattributes for sprite text.

----------------------------
Limit
----------------------------
wrapExact - added, this new wrap method wraps a sprite exactly the width or height of a limit box, the wrap method aligns sprites this is no good for scrolling text displays, use this method for that. You may need to ensure that regions are wider and taller then the view area to stop pop in happening.