© Seth Kenlon 2019
Seth KenlonDeveloping Games on the Raspberry Pihttps://doi.org/10.1007/978-1-4842-4170-7_9

9. Balance of Power

Seth Kenlon1 
(1)
Wellington, New Zealand
 

There are a few small bugs in Battlejack, and a few opportunities for a better user experience. This chapter fixes the bugs and adds some features to make the game flow better.

The first bug you may not have noticed yet: if you click the mouse on the menu screen, the game crashes. This is caused by the main.lua file forwarding any detected mouse press or release to STATE.mousepressed() or STATE.mousereleased() , and finding no corresponding menu.mousepressed() or menu.mousereleased() function .

The fix is simple: create functions to process mouse events on the menu screen. Since no ...

Get Developing Games on the Raspberry Pi: App Programming with Lua and LÖVE now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.