Yuheng Huo / Mbed 2 deprecated hyh_copy

Dependencies:   mbed FXOS8700CQ

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers life.cpp Source File

life.cpp

00001 #include "life.h"
00002 
00003 void life::init(){
00004     lives = 3;
00005     int d[56] = {
00006         0,1,1,0,0,1,1,0,
00007         1,1,1,1,1,1,1,1,
00008         1,1,1,1,1,1,1,1,
00009         1,1,1,1,1,1,1,1,
00010         0,1,1,1,1,1,1,0,
00011         0,0,1,1,1,1,0,0,
00012         0,0,0,1,1,0,0,0};
00013     }
00014 }
00015 void life::update(){
00016     lives=lives-1;
00017     
00018 }
00019 void life::display(N5110 &lcd){
00020     for(int i = 0; i < _num; i++){
00021         int x = 0 + 8*i;
00022         Bitmap p(icon, 7, 8);
00023         p.render(lcd, x, 0);
00024     }
00025 }
00026 
00027 int life::liferest(){return _num;}
00028