I am learning OOP using c++ on a MicroBit by developing this simple game

Dependencies:   microbit

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Bullet.h Source File

Bullet.h

00001 #ifndef BULLET_H
00002 #define BULLET_H
00003 
00004 class Bullet: public Sprite{
00005     public:
00006     void move(){
00007         int y = getY();
00008         if(y == 0){
00009             setY(4);
00010         }else{
00011             setY(y-1);
00012         }
00013     }
00014 };
00015 
00016 #endif