HTML and CSS Reference
In-Depth Information
Enemies attacking the buildings
In this task, we allow the enemy to stop and atack the buildings that block their way.
Prepare for lift off
The explode animaion is made up of three graphics. We may use the bundled assets.js
file for this, or we may use the following spritesheet image if we do not have access to Adobe
Flash's assets features:
Engage thrusters
Let's code the interacions between the enemies and buildings:
1. We add the following damage logic to the building's base file:
// The base of Building definition.
;(function(game, cjs, lib){
function Building(){
cjs.Container.call(this);
 
Search WWH ::




Custom Search