Thursday, December 25, 2014

Last post of the year 2014

There are some chances of getting proper graphics, hooray!

Binary can be download at OneDrive as

What's new?


  1. Finally fixed a bug with the seamless backgrounds with H/V speeds
  2. New methods TLayer.AddAnimation() / RemoveAnimationAt()
  3. Sprite animation flow moved to Tick()
  4. BB Rect calculated now on demand in sprites
  5. SetDefaultBB removed from sprites
  6. Some more functions inlined
  7. Default screen quicksort buffer sorting changed from 31 to 63 (in order to make it stable)
  8. Some warnings removed
  9. New TLayer.AsRect
  10. New TLayer GetAnimationInfo() and NewAnimation()
  11. New TLayer MoveCell() and MoveAnimation()
  12. New TSprite IsMoving()
  13. Collisions rotations matrix not calculated if no angle
  14. Bezier curves finally working properly
  15. New TWater class in sprites  (based on springs)
  16. Collision matrix now check boundaries properly
  17. When drawing surfaces, if not angle set then rotation matrix are not calculated
  18. Layer cells with no tile but attribute also dispatch event OnReadCell
  19. TRandom.NextFloat(max) improved
  20. SpriteEngine.Render method cleaned a bit more
  21. TLayer.Render refactored
  22. Some important fields in sprites are now stored in variables (like width, height, bpp and colorkey), to make faster access
  23. More fields moved to TDummySprite so they can be inlined
  24. New sprite property Active
  25. TObjectEx now implements IData


  • New element Lamp that emits some light
  • Ball now has bouncing delays
  • UFo's laser now shrinks properly with colliding against solid stuff
  • Coins can now be also affected by gravity
  • New enemy mild
  • New enemy torno
  • Ray optimized a bit
  • TrapDoor code was a bit messy
  • New enemy Bouncer
  • Falling blocks are activated when hero is close
  • New TGameSprite.IsVisibleWithCam() in order to reduce the overhead in entities
  • Spotlight hitting code improved
  • Auxiliary sprites also get the Paused property from parent
  • Trapdoor also kills enemies
  • Arrows stuff moved to Tick()
  • Arrows code cleaned a bit
  • Spider net code improved
  • Water will try to fill gaps
  • Collision code improved
  • Crushing code refactored
  • Removed duplicated code for exploding bubbles
  • Fixed some collision priorities with tiles and items when gravity is up
  • Snow falls slower
  • Collision against moving platforms with reversed gravity will work much better
  • Collision against left and right slightly modified in order to be more accurate
  • Blob was falling when it should not
  • Book info instance reference was totally wrong
  • More cases for collision against tile/item
  • Bubbles when exploding become inactive (they are not gone since exploding takea a while)
  • Only active platforms are checked
  • Now HBF can also display yes/no dialogs
  • Hero now always faces none when jumping
  • Runes index was not set properly
  • New class TNeutral
  • New class TLight put it on top of tiles to make cool effects
  • Blob and Weird now are gray based and then randomly colorized
  • New element barrel, the only special thing is that inside water it floats...
  • ApplyEnvironment removed
  • Now fishes collapses if no water
  • TNeutral = TStatic
  • Pause code is more implicit (pause <> locked)
  • New demos
  • Grass only moves when hero is close
  • New enemy Head
  • Water flow refined
  • Water/Lava improved
  • Generic platform code refactored
  • Bird moves are now based on bezier curves
  • New enemy firebug
  • Enemy thing now more stable
  • Liquid stuff improved
  • New gamesprite helpers SameRow() and SameCol()
  • Bird now uses some TFuture<> for calculations
  • GearWheel now detects properly slopes
  • Slopes can be seen in debug mode
  • Water now uses spring system
  • Weird now keeps direction when current block disappears (so does no longer gets crazy)
  • Now lasers also stops with items (not only tiles)

New dynamic water:

Some new traps:


Saturday, October 18, 2014

Focusing on refactoring code and new backgrounds

As usual some bugs fixed here and there but focusing on creating better code, why?, because it will be the base for the next game.


  • Screens code refactored
  • New method IDriving. JumpTogether()
  • Added some fading in menus
  • Better use of IBubble rather than TTBubbleSpawner
  • Trail now has a timeout of 10 seconds 
  • More animated tiles in backgtounds
  • Fade speed can be adjusted via game property
  • Normal and mechanic enemies can now be crushed by moving items
  • Some class cast changed to IGameSprite 
  • Weird uses different colors 
  • All pickups now execute their specific code
  • Some pickup specific code moved to its corresponding class
  • New IDoor and IProfile interfaces
  • All own counters removed and now using Ticks
  • Gatashi flapping sound stops after he dies
  • Many new background s
  • More stuff moved into Tick() rathern than Render()
  • Fight sets zoom to 100 by default
  • New LaserGrid element, beware
  • Stone does not rotate when on top of a carry item
  • Achievements update is not called every frame but on certain triggers
  • Fixed an issue where an achievement could also be valid for next level  
  • Some maps changes
  • New interface ISettings 
  • TSettings is no longer a singleton class
  • Shadows are cast only if there is a solid block behind
  • Background effects, autofit, seamless, etc can be configured from editor
  • New class TVehicle 
  • TCardRide now inherits from TVehicle 
  • Fixed a bug while walking on top a vehicle
  • New enemy UFO 
  • New enemy Thing 
  • New enemy Horus
  • Any entity can use vehicles not just hero
  • New property GameSprite.Child, TVehicle uses it in order to know who is using the vehicle
  • New animation when hero is landing 
  • Cardride now set its own state properly
  • New status ssLanding, hero uses it
  • Fixed a bug where unlocking coin achievement could be applied to next level


  • Manual timeout is not override with value equal one  if there is no configuration
  • New property in Sprite ShadowZoomDelta
  • TSprite.HandlerTriggers() is now executed on Tick()
  • New Ticks counter 
  • Tick() is no longer attached to sprite engine but to the own sprite render 
  • New interface IData is related to ITag in order to pass info to objects
  • New interface ISpriteEngine 
  • New property TGraphicDriver.BuffersUsed
  • Removed all *2 variables for keeping values and now all is done properly when paused via Tick()
  • Tick() now also handles sleep/timeout/speed aspects
  • Beam size of Laser can now be adjusted
  • TLevels has now some new handy methods like Previous, IsCompleted, First, Last and Next

New backgrounds)

Sunday, September 7, 2014

Harmonizing the code

Since project is getting close to the end (hopefully), I'm trying to improve those parts of the code that I'm not happy, so this time it was about splitting render code into Render() and Tick() methods, before it was a bit of a mess.

what's new?

  • New enemy Sam (not used yet)
  • HandlingMovingPlatform() finally uses spatial partitioning
  • Fire emit some light 
  • Some different backgrounds tiles
  • Cardride response to the changes of slope with proper angle 
  • Slope detection simplified a bit
  • New property TGameSprite.Sticky
  • Cardride now uses new sticky property in order to not move away from rails
  • Slope calculations are now more accurate
  • Removed some singleton classes and adding them as interfaces via GameServices 
  • Removed an extra explosion sound when bomb exploded
  • Gatashi didn't kill the screen sprite spawner when dying
  • Darkness detection code improved, old code was slowing down the performance
  • GameServices is now fully working, no need for extra information
  • Updating all elements to use the new Tick() rather than have all the code in Render()
  • New credits screen 

  • TSpriteEngine render method was wrongly assuming that all sprites were TSprite 
  • New interface IShadow
  • Heights for slopes are calculated on demand
  • It is possible to get the angle of the slope 
  • New closure event for rendering
  • Slope angle can be retrieved more accurately
  • Many fields changed to cardinal rather than integer
  • Slope initialization was wrong
  • New Tick() function that is called when sprites are not in pause 
  • OnRenderClosure() has a serious problem with the Die param

Monday, July 21, 2014

Summer is here!, too hot to code... (va por ti, para siempre)

What's new?

Items from Layers refactored and improved with spatial partitioning
Destroying sprites is now more reliable since it does not use AutoHandled 
TObjectEx and TComponentEx both implement ISelf 
TSurface.CalculateHeights() was not taking properly the alpha value
Some 32 bits masks fixed in surfaces
Items didn't have shadows, fixed
New ICamera2D.Follow() 
Making quicksort stable number set to 31 rather than 15
New TLayer.PopPropertyAt()

Stones improved
New secret level! 
Arrows source  code move to enemies folder
New sprite dispatcher entity, it can dispatch any entity based on frames, proximity or randomness
Moving items can also fire triggers
Spike and arrows has more behaviors (not only cadency style)
Tiles can be marked as Movable 
New trigger ClearText()
Cruswall is now a TBasicPlatform
Using ISelf.AsObject to cast to objects (performance issues)
Mirror Tracing should be x,y not CenterX/Y
OnOff does not have to update when in pause 
OnOff has now a behavior: random, cadency and touch
OnOff has a new chances property, default = 0.5
Move accurate platform detection of bound attributes
Bat now use proper 3d play sound method 
CarryTile = CarryItem 
Eye enemy becomes red when using laser
Fixed an error when detecting collision with platforms while changing direction 
TRotatingCloud now works properly
Background X it is also scrolled (why I didn't do that before?)
TGameSprite.IsPushable() was always returning true, fixed
Pushable items set as IPushable 
Arrows also fall when colliding with mechanic or indestructible enemies
Card ride can move on rails and hero can mount it (use it in last level, still not finished)
Cardride dos not get stuck when colliding against a wall after jumping
Carride cannot jump twice
HBF.UpdateCamera() uses cam.Follow()
Thrown lava is not created when there is more lava on the top
Removed many calls to GetCollisionData() that were not needed since it is done automatically at Element level
Arrows are now properly cut when spawning them
GetCollisionData() now gets info from cells and items 
New enemy catcher (comes with different formations, used in Break It)
New Anemone element 
Bubbles are now pushable
All spawning entities now inherit from TSpawner
New enemy Catcher 
New enemy Trail 
Now all entities can create water bubbles (like Anemone)
Fixed a minor bug where hero was playing a splash sound in see level (you are already inside water...)

Mounting a card ride:

Some Anemones:

BTW, please help my friend visiting his new game page at Bloxland Story

Monday, June 16, 2014

Pushing tiles

Now hero is able to push many objects, making the game more interesting.

All binaries should be at skydrive 

New Layer property X and Y in order to do nice scrolling effects
Some bugs fixed in Layer when looping and moving around the X and Y
New method TCamera2D.Rotate()
Sprites react to the new previous method
TVector is now TVectorEx
Shaders can be also loaded from big file
Map items class can be defined

Rays didn't have proper collision box
Planets can bound vertically among them
Runes inventory is shown while picking up runes
Hero impulse increased 0.2
New effect for high scores
Shaders are now also packed
When a rune not owned is taken, it visually moves to its slot
Hero was automatically taking dead runes, hooray!
Arrow code refactored
When arrows collide among themselves they collapse
Hero does not longer needs reversed animations
Items can be now pushed (starting to think about some puzzles)
Bounce enemies now also bound with moving items
Items can have now gravity
Frog has a sound when jumping
Pushing tiles does have a sound
New sound for lava
All important map items are now classes
When arrows are falling they cannot kill hero
New interfaces IBubble, ISolid, IPlatform, IBall, IBubble, ISpring, IIce and ISlope
Many VARS removed
New element card ride, it can be pushed
New solid tiles
Arrows are respawn after 1 second (also avoids the nasty repeating sound)
Fixed collision against items with same direction
Solid items do not rotate when changing gravity
Solid items are now affected properly by gravity
Items detect other items so they can be piled
New sound when entering the water
Grass and Cotton are now fix elements
Any item can now be tagged as ice
Now lava throw fires balls
New enemy stone
Bubbles can only be exploded once

Level X?

Monday, May 26, 2014

Bugs, go away!

How many bugs are unknown in your application by average?


  • Tile cache in maps was not clear after new level (didn't affect game play)
  • Fixed error when creating screen buffers, first thing should be always create material 
  • Buffer ent code improved (3d stuff)
  • Files searches in big file are now much faster
  • Fixed when rendering to texture and the surfaces were lost lead to an AV
  • Fixed a new collision weird assignation
  • Triggers can be executed from the code
  • Fixed an issue with module volume
  • Closure versions of Engine.Find() and Engine.SpritesAt()
  • Closure version of Layer.ScanAttributes()


  • New element flower
  • New element star 
  • New element boom 
  • New cotton element 
  • New effect fire wall
  • Snow improved
  • New mechanic enemy beetle 
  • Now hero is pushed down properly from falling items
  • Reminiscence music for intro
  • New sound for last battle
  • Web fall after 1 second of catching a sprite 
  • Fire was moving when in pause 
  • New secret level 
  • Game could not be finished twice
  • Fixed some bugs in the platform bouncers
  • Code related to levels and profile cleaned
  • Issue with boss1 and its fire balls (compiler should warn about non initialized array)
  • Hero with shield is now not affected by web 
  • Platforms now also get default layer var
  • Candle light does not move when in Pause
  • Ray pillar colorkey was not correct
  • Dialog can be seen properly in darkness
  • Now boss1 fire balls emit light in darkness
  • boss1 = kurkani 
  • Snow should be now be more sparse
  • Runes and coins now collide with tiles/items on top
  • More type of candles 
  • New fire jumping ball
  • Crepuscule can be set from top
  • Start Z properly adjusted
  • All circular enemies collision shape set to csCircle
  • All rotating enemies do not longer react to the Reverse event
  • New interface IHud
  • Now Finish screen shows the number of lives 
  • When hero dies with gravity up it falls down
  • Now game uses the closure versions in some functions that are used quite a lot, meaning no overhead creating lists 
  • Fixed a collision when tile vs item when gravity is up
  • Fixed a gravity collision issue, it was not affecting beetles because of its height
  • Gravity color switch is now faster
  • Spider now correctly does not get too close to hero when he has immunity
  • Fixed a weird collision issue when the gravity change too close to a tile

Sunday, May 4, 2014

"Only" improving the graphics is pending

Thanks to JLG the sound/music part is almost done, great job men!

Now pending for the graphic part...


  • Dialogs can be skipped pressing return
  • Removed some unused variables in focus 
  • Finally fixed some silly bat bug
  • Removed some unnecessary collision detections against hero
  • Fixed an issue with speed factor
  • Removed some unused units
  • Keys now rotate
  • Now all levels have music 
  • TScreen new property GameServices and refactoring
  • Ending more or less finished
  • Deleted some legacy 3d resources
  • Droid was not taking properly the orientation
  • New sound for the magical stuff
  • Enemies cannot hit hero when he is already dead
  • Highscores screen have a gradient background
  • New sound for balloons exploding
  • Source structure refactored
  • WrongPlace() now is much more accurate with for instance lava
  • Hit animation improved
  • World background is now different
  • All tiles are now 64x64 rather than 64x62
  • New sound when stalactite breaks
  • New TGameSprite GetDefaultHorizontalSpeed
  • TD3D Colorkey improved a bit 
  • Now hero has 5 lives
  • Shadows are "dynamic"
  • Die animation is much faster
  • Fight screen now takes the current view rather than a flat background 
  • All sounds are normalized 
  • Levels starts with a zoom 
  • Darkness is not so dark anymore
  • New colors for the finish level screen 
  • Transition musics are now coming from configuration
  • New screen when entering the game, deja voo!
  • Error with bubbles when in bottom of the Level
  • Using Bass rather than fmod 
  • Sound queue improved
  • Improved the use of GameServices in GameSprite leading to less code
  • Book sprites rather than egg
  • Rain is now diagonal
  • New achievement, kill all enemies (very tricky!)
  • New wind sound 
  • Dragon tail now cast shadow 
  • Layer 1 and 2 uses the same Z
  • Egg has been discarded, now a book it is used which makes more sense in the fight
  • When candles are off they do not emit more light when in darkness
  • New pickup Skull, beware...

  • New TSurface.key reference to related classname so it is easier to debug 
  • TSurface2Poly.Tolerancy should be an integer not a float
  • Removed some really silly $IFDEF in TSurface which makes really weird random errors 
  • Tag removed from some classes that already have them since they inherit from TObjectEx
  • TSimpleSprite.LoadFile() was not passing correctly the colorkey wo the stream overloaded version
  • Some really weird visual issues fixed
  • Now FillSurface() does all the job, move the data from the bitmap to the surface, does the colorkey and also the flipping, this improves the assignation of surfaces
  • New TSurface.SurfaceType field with options: default, managed and target
  • D3D specific classes improved a bit
  • Improving TSurface.Blit()
  • Added support to BASS sound system
  • TSurface.Blit() errors fixed
  • New engine.Exists() a fast function in order to check if a certain class exists 
  • New Layer.number property
  • Fixed a z shadow bug, it was not updated properly in TAnimationSprite
  • Trigger parameters can now be booleans
  • Items now also trigger the event OnReadCell()
  • Alpha tiles do not cast shadows 
  • Removed some warnings in BigFile

Thursday, April 24, 2014

Bug fixing, the never ending story

Fixing bugs, do they ever finish? :-)

All binaries should be at skydrive 


  • New Engine.Debug property (it set all related sprites to debug)
  • TLayer.Trace() could raise a AV since under certain conditions a cell can be null 
  • Events from sprites moved to their own new class TEvents 
  • Screen buffers size is now a property


  • Final boss getting better
  • When final boss dies he liberates the key
  • Final boss has a new sound when flapping the wings
  • SpriteFactory now gets IGameServices rather than many properties
  • Arrows behave better against bullets
  • New enemy mine, it  has a gravity factor of 2 and kills Enemies
  • Finally rays have a pillar 
  • New trigger method ItemOffset() in order to change the current tile
  • Die sound is more calm (it was too loud)
  • New horizontal trap doors
  • Bomb has a gravity factor of 2
  • One can observe the rendered tiles (used in final boss for heating ice)
  • New method PreciseCollideAgainstTiles(): bool which tests 8 precise collisions
  • GravitySwitcher now publishes Flashing and Quake duration properties
  • Mirror checks for obstacles (if there is an obstacle then the sprite cannot be mirrored)
  • Stalactite, flame and wall now  properly check for collisions (not only for spatial partitioning)
  • Droid,eye and final boss heats the special ice cubes and also mechanic enemies
  • Eye now publishes initial angle and laser color 
  • Arrows are now enemies
  • Candle vanish slowly
  • New Focus element (used in Colors screen)
  • Focus color can now be set as and mask via DirectColor attribute
  • Spotlight now slows down also enemies
  • Published attributes can now also be enumerators
  • Spider web when touching sprites they get locked until the web disappears
  • SLOW_VAR removed, instead SpeedFactor is used
  • Runes are now shown in the achievements menu and not in the hud
  • Observers are cleared properly otherwise AV
  • Candle new property off so when true it won't emit light when in darkness 
  • A bit clever approach for the sounds pool
  • Fixed a small issue with the steps when taking the key 
  • Now when the default resolution does not work, the game properly restarts at 1024x768

Friday, April 11, 2014

"Close" to finish

Well, it is time to close this never ending project, so I'm just trying to focus on bugs and last boss level.

All files should be at skydrive  (well, sources not any longer)

  • From triggers you are able to pause and continue the game showing some text
  • Trigger dispatcher now gets all the info from IGame
  • New interface IDialog
  • Mummy jumping areas detected more accurately
  • More music!
  • TGame.SpawnAttributes() refactored a bit
  • Rotated coins attributes are now published
  • New sources folder structure
  • Items bound not only when finding a bounce attribute but also when colliding with a solid tile
  • Items can also have set their properties (clouds, on/off, moving tiles, red ball and spring)
  • Last level boss fight! (wip)
  • New sound when balloons explode 
  • Bird does no longer appears from no where... (bug fixed)
  • New sound for eggs 
  • New sound for arrows
  • New sound  for rain
  • New sound for menu 
  • Now pause has a sound 
  • Some pickups have a new sound 
  • Fish animation is now PingPong rather than circular
  • Stalactite does not fall if hero is dead
  • Text dialogs fit a bit better
  • New menu Music
  • Platforms code refactored a bit

  • Font stuff moved to BB.Screen.Fonts
  • New method Layer.GetExtraAt()
  • Map triggers have a new property align which tells the system how to align the trigger (only for collision purposes since they are invisible)
  • ITag removed from some classes since they derived from TObjectEx which already implements that interface
  • TSprite IsOutOfScreen is a bit more consistent
  • Now the engine can be paused  (much more handy and easy than pausing all enemies)

The final boss

Monday, March 31, 2014


Now it was time to apply values to attributes in real time in order to let the potential designer the power to desire the levels behavior (in this case the designer is me...)

Of course this is achieved via rtti and publishing all interesting properties, in our case:
  • Colorkey
  • Collision info
  • Effect (add, sub, multiply, inverse)
  • Filter
  • Angle
  • Color
  • Horizontal speed
  • Vertical speed
  • Zoom
  • Acceleration
  • Friction
  • Gravity
  • Facing
  • Animation info
  • Shadow info
  • Sleep
  • Timeout
  • Coordinate system
  • Group
  • Flip x/y
  • Visible
  • X/Y/Z coordinates
Also all special attributes from all entities in the game are published.

All files should be at skydrive  (well, sources not any longer)

  • Scanning polygon algorithm is now more accurate, I hope this fixes some weird collisions 
  • New TSurface.Target property used when rendering to texture
  • When calling TScreen.SetRenderToTexture() the system first render to a texture and then to screen 
  • Screen quad can be zoomed and rotated thanks to the rendering to texture
  • Fonts can be now loaded from big file
  • When setting a sprite as no colorkey the bounding box is also set to full rectangle 
  • One Trigger can now have multiple calls (before it was one trigger one call)
  • Many class properties are now published in order to be accessible from Map editor
  • TLayer has a new method in order to get information about properties called GetPropertyAt()
  • Map extras now cast shadows (like fire animations)
  • Shadows can now be assigned at any time, not only before assigning a surface
  • Sprites take by default the shadow from the engine (if available)
  • Attached engines in maps take the shadow from the Map
  • TSound keeps the name of the loaded song (useful for debugging)
  • Y shadow offset set by default to 4 (before it as +4)

  • Enemies getting angry code refactored (now it is generic)
  • Spike ball now rotates according to its angle 
  • Fixed some platform code issues when gravity was up
  • OnPickup event removed, always use OnDie
  • Bouncing code refactured and tunned
  • Finally new "legal" music is coming (thanks to herotyc/xplsv^asynkro)
  • New crepuscule lights here and there
  • Enemies cannot longer activate moving platforms (only hero does it)
  • Now hero collides properly with moving items when gravity is up
  • When bubbles are exploded with head, the jump is not stopped
  • Stalactites now breaks items and kills enemies
  • Fixed a bug with camera where in some levels was showing stuff outside the map
  • More accurate balls bouncing (level severe gravity)
  • Fight now respects the current shader 
  • Dialogs can be paused 
  • Dialogs can be chained
  • Game now shows some dialogs while playing
  • Arrows now can have dynamic speed
  • More entities get published attributes
  • Now candle fades slowly 
  • Waterfall now has a sound 
  • Fight screen was stopping all sound, that's wrong now it pauses all sounds 
  • Outside there level does not longer cast shadows (since it does not have background)
  • New font 16x16 for dialogs
  • Blob speed set to 1.5
  • Spider leaves webs while walking
  • Droid collisions improved

Better sun lights

Monday, March 17, 2014

Stabilizing HBF

Playing a bit more with scripts and gravity and also trying to stabilize the game.

All files should be at skydrive 


  • 32 bits textures are recognized and used in a better way
  • TCollisionMatrix more stable when coordinates are outside the grid


  • New element ventilator (used in No Name)
  • Triggers can lock/release the keyboard
  • New triggers: FadeIn, FadeOut, SetVar , ShowEntity, ShowHero, LockInput and ReleaseInput
  • Fixed an issue replaying demos 
  • New gravity switcher up/down
  • Gravity down bitmaps are now blue
  • Gravity color shifting cadency it's now slower
  • Fixed an issue when graviting (system thought it was colliding up and down)
  • TEffectDispatcher is now singleton (many classes need to use it)
  • Many counters now use TTimeHelper.AsSteps() (converts milliseconds into game steps)
  • Time pickup now only slowdown mechanical enemies
  • Bomb now gets angry with different gravities
  • Dragon slower (used in Colors)
  • Teleports cannot be reused when are in used
  • All normal enemies get angry when touching flames
  • Bubbles spawning cadency increased  

Sunday, March 9, 2014

Focusing on triggers

It's been a while since the last update, so it is about time to do something...

All files should be at skydrive 


  • Params trigger now accepts string values
  • Fixed a bug when in a trigger the same function is called more than one it would always get the same parameters
  • Remove TSprite.UseEngineZ and added TSprite.AlternativeZ


  • When in water and bubbles are visible a new sound is played
  • Trigger ClearEntity now works since the attribute it is saved in ENTITY_VAR
  • Blob gets angry when touches a flame
  • Droid's laser was not pausing properly
  • New explosion for walls
  • New giant gear wheel (not used yet)
  • Egg is now nicer
  • Sounds can be searched by name
  • New trigger dispatchers: SetParallax, SetNight, ClearItem, Flash, Quake, ShowText, StopMusic and StopSound
  • New unit Dialogs, that helps showing text on screen
  • Playing demos was letting you play new levels, fixed
  • Escape is not enabled when in pause
  • Spotlight light collision fixed
  • Top VS bottom collisions better handled
  • Hero's tail code improved a little bit

Friday, February 21, 2014

Time for triggers

The main change in this version is that I've added a triggering system, in the map editor one can add as many triggers as he wants.

There is a file for each level called


The values mean:
  1. TriggerId
  2. Trigger x position
  3. Trigger y position
  4. Function to call and parameters

Then there is class called TTriggerDispatcher which contains all possible methods to be called, for instance:

procedure TTriggerDispatcher.PlaySound(aX, aY: integer; const aName: string);
  TSoundDispatcher.Instance.Play('Sound\' + aName);

procedure TTriggerDispatcher.SpawnEntity(aX, aY, aOfsX, aOfsY, aEntity: integer);
  info: TMapInfo;
  entity: ISprite;

  info := TMapInfo.Create((aX + aOfsX) * FLayer.XTileSize, (aY + aOfsY) * FLayer.YTileSize, NO_TILE, aEntity);
  entity := TSpriteFactory.Instance.New(info);
  (entity as IWarp).Warp;

The way that this is handled is via rtti:

procedure TGameTrigger.Invoke;
  info : TRttiType;
  method: TRttiMethod;
  params: TArray<TValue>;
  context: TRttiContext;
  par, i: integer;

  if FTarget = '' then
    raise Exception.Create('Invalid target');

  context := TRttiContext.Create;
  info := context.GetType(TTriggerDispatcher);
  method := info.GetMethod(FTarget);
  if method = '' then
    raise Exception.Create(FTarget + ' does not exists');

  Setlength(params, FParams.Count + 2);
  params[0] := TValue.From<integer>(FX);
  params[1] := TValue.From<integer>(FY);
  for i := 0 to FParams.Count - 1 do
    if TryStrToInt(FParams[i], par)  then
      params[i + 2] := TValue.From<integer>(par)
      params[i + 2] := TValue.From<string>(FParams[i])


  method.Invoke(TTriggerDispatcher.Instance, params);

From the map editor one can design some game logic. All files should be at skydrive

  • If no animation assigned in TAnimationSprite then the old exception is no longer happening
  • TCollisionMatrix no longer returns the same sprite repeated
  • New trigger system
  • Triggers can dispatch more than one method 
  • Map load/saves triggers
  • New balls enemy 
  • New trigger entity
  • New music for level no name
  • CrushWalls fixed
  • When hero is finishing a level, immunity is activated
  • Possible triggers at the moment are: clear and set tiles and attributes, play sound and music and spawn entities
  • When in water and bubbles are shown and new sound is played
  • Triggers used in some levels

Saturday, February 15, 2014

New cloud repository

Since SugarSync insists on making me paying them I've to find alternatives...

All files should be at skydrive

Monday, February 10, 2014

Just another update

Well, just to keep this blog a bit "active" I'm uploading a new version

BTW, SugarSync is already telling me that our deal finishes in 7 days, time to find another place to save the files, but meanwhile here we go SugarSync.

Engine.Find() and Engine.SpritesAt() returns nil if no sprites (some performance gain)
Minor clipping issue solved (only visible with teleporting)
TDummySprite new property Group
New Engine.Find() per group
New Layer.GetItems() per group
New ICamera.GetPoint()
New ISprite.GetPoint()

Music was not resumed after a fight
The under 15 minutes achievement has to be done from the first Level
Hero dies differently...
Shield was not shown when in pause
Some non used graphics removed
Bomb enemy is back with some new explosion (nuclear?)
Bomb now dies with hero shield
All code adapted to Find() and SpriteAt()
Dragon included in level Colors (I think it gets very difficult...)
Spring handling improved
Jumping code harmonized
New falling blocks (crush wall)
New static Play3D() sound that does not need ISprite but TPoint
Time pickup now rather than stop the enemies it just slow them down quite a bit.

Dragon flying around...

Saturday, January 25, 2014

I can play demos

Aside from some small bug fixes here and there, the main change is that HBF can play levels by itself. They can be seen in the Demo menu.

Binaries and sources can be downloaded from SugarSync.

When adding color to sprites, shadow is no longer affected

Now game is able to play demos
I think that finally I caught a nasty bug. Lesson learned: don't internally use fields that you expose for user usage (for example Tag)
New enemy snowball that can freeze the floors when touched (getting smaller)
Many elements now have a shadow (like candle and door)
New bat sound
Pickups can be inactive, used for runes and coins from diamonds
Bubbles explode outside the water
Droid now can also bounce vertically
In order to unlock the achievement "finish with all lives" one must start from first level
Coins that vanish disappear via Warping
Pickups can be active/inactive
New achievement, finish HBF under 15 minutes
One can skip the sentence challenge with escape
System respects the banners order
Coins from Diamonds are affected by friction, and eventually, they stop
Runes don't move after they touch the floor

New soil freezing via snowball:

I can play demos

Aside from some small bug fixes here and there, the main change is that HBF can play levels by itself. They can be seen in the Demo menu.

Binaries and sources can be downloaded from SugarSync.


  • When adding color to sprites, shadow is no longer affected


  • Now game is able to play demos
  • I think that finally I caught a nasty bug. Lesson learned: don't internally use fields that you expose for user usage (for example Tag)
  • New enemy snowball that can freeze the floors when touched (getting smaller)
  • Many elements now have a shadow (like candle and door)
  • New bat sound
  • Pickups can be inactive, used for runes and coins from diamonds
  • Bubbles explode outside the water
  • Droid now can also bounce vertically
  • In order to unlock the achievement "finish with all lives" one must start from first level
  • Coins that vanish disappear via Warping
  • Pickups can be active/inactive
  • New achievement, finish HBF under 15 minutes
  • One can skip the sentence challenge with escape
  • System respects the banners order
  • Coins from Diamonds are affected by friction, and eventually, they stop
  • Runes don't move after they touch the floor

New soil freezing via snowball:

Wednesday, January 15, 2014

Time for achievements

Nowadays a game needs achievements, so why not implement them in my own style?

Binaries and sources can be downloaded from SugarSync.

Sprites clip are set to empty not only when creating it but also when loading (since I reuse them)
New ISprite.GetCurrentFrame()
Some checks in maps are only done when in DEBUG mode
FlipX() and FlipY() renamed to ToggleFlipX() and ToggleFlipY() and new property FlipX for helping the getters and setters

New achievement system, at the moment there are 21.
Achievements visuals are updated always when menu is shown
Princess is now a pickup
New banner system, more handy to use
New music for last level
Change the arrow speed from to 4 (so is a little bit faster than hero)
New golden egg pickup, if taken (it changes its location from time to time) it starts a battle, if battle is won, runes are spawned, try to collect them all
Achievement all coins fixed
Profile system improved
Profile storage now uses a dictionary
Droid only can only kill normal enemies with the laser
Eye only can only kill normal enemies with the laser
New interface IProfile
Hud hows all collected Runes

New fighting room (remember ranarama?)

New golden egg

New achievement system

Many runes to be collected

Monday, January 6, 2014

HBF, first 2014 update

Finally Xmas is over!, in between I found some time to improve this little game mess, latest changes:

Binaries and sources can be downloaded from SugarSync.


  • Rectangle collision uses bounding boundaries rather than rectangle, so is more accurate
  • New method TCamera2d.Reset()
  • Font can now have a 2d camera 
  • Screen buffers are no longer created with huge size since most of the time they are under used, now they are discarded when more vertices are needed and then exponentially increased, default is now 512 vertex (before it was 32768), memory footprint reduced dramatically
  • New BB.Game.Achievements unit


  • Trap door now uses a rectangle collision (it cannot use a polygon shape since the system can only generate one polygon and this bitmap would generate two)
  • HUD refactored a bit
  • Coins stuff moved to HUD 
  • Map tiles changes
  • Bottom contact adjusted when testing left and right collisions
  • Spikes and flames take tile height as reference
  • Jellyfish moves faster
  • Now hero falls in small gaps
  • New world view at the beginning of the game (it shows all levels in miniature)
  • Screens code refactored
  • New teleport element 
  • Teleports can be grouped, so one can have many on the same level as long as they are in different groups
  • Hero's immunity activated when entering destination teleport since an enemy can be moving there
  • Princess has more Z priority
  • Crab collision when waking up has been improved
  • Droid laser speed set to 1
  • Droid does not stop when it is closed to tiles (avoiding potential gliches)
  • Hover collision system against tiles improved
  • Hover collision system is now based on physics when colliding with other hovers 
  • Titan collision with enemies improved
  • Start attribute checking, now it checks for no start or more than one start
  • New level The Ending, now is a big maze
  • Moving platforms bottom check fixed
  • Bat collisions improved
  • New game over screen 
  • New stalactite bitmap
  • Fixed a bug when hero was dying and a bubble catch him
  • New waterfall tiles (trying...)


  • Grid is visible again

New world presentation

When game is finish, there is also a new presentation

New level for The Ending