Friday 25 January 2013

Attack function


Next up is the attack function.

I have re desinged the game slightly since changing the genre of the game from 2.5 plat former to enchanting 2.5D innovative runner game.

The Flesh of the god statues which where orginally going to be collectables such like coins in Mario games. But now they will be spread out sparingly in each chamber - their purpose is not to boast a score, or reduce a bosses hp but to magically unblock the path.

So, the player could run for an age and miss collecting a Fotg statue and contiunue runnnign avoiding enemies and will eventaully not be able to continue running so they must run back the way - hitting the blocker will end their game to the current chamber or option to quit to menu




The programming addenda for the following sprint week is as follows >

* The run animation for the player 
The game code design and revamp of the story introduction 
* redesign of the button layout for the screen 
redrawn slides for the introduction of the game + skip function 
* Code collision from unit test coding  
* Add in the mummy and boulder sprite; create a spider & bat sprite 
* Make the Hp bar a sprite sheet (should take more than reducing the brightness of some of the beads)
* Create a chamber door exit level sprite 
Create sound and add sound?
* Create ceiling blocks
* Set up the attack functionality
* Create tutorial screen for playing the game
* Create chamber way blocker(s) ( set up gameplay for left/right change) - up from ground 
* Collect Flesh of the gods to unblock the way to the exit
* End level sequence (win - to start the next chamber lose - to either play again or return to the main menu)
* End game sequence




The blocker will be look more magical. Preliminary design 




These blocks will fall from the ceiling and will mean that the player must jump over them (they remain there when he turns)

The attack function will be coded as follows:

var Attackpower = pulse.Sprite.extend({
init: function(params) {
  this.lastMoveElapsed = 0;
},
update: function(elapsed) {
if(attack){

  this.lastMoveElapsed += elapsed;
  if(this.lastMoveElapsed >= 4000) {
    this.visible = true;
    this.position.x = Player1Inst.position.x; 
    this.position. y = Player1Inst.position.y;
    this.move(1, 0);
    this.lastMoveElapsed = 0;
    }
  }
this.visible = false;
 }
)};


this means that when the attack button is pressed and the attack boolean variable is set to true, the attack power will be visible and shoot out for a duration of 4 seconds from the players x and y co-ordinate then it will disappear.


The tutorial screen should convey the following information:

The player moves at a constant rate in order to race to the chamber to beseech a blessing 
The player can move left and right (when they are displayed on screen) to dodge Sets magic 
The player can jump or attack 
The aim is to get Kareem to the end of each chamber ad eventually confront Set 




No comments:

Post a Comment