![](/media/cache/profiles/301b144af4d1614dbcf92f9710be50fb.jpg.50x50_q85.jpg)
Race around the city collecting the flags while avoiding those that stand in the way of your mission. Make no mistake you will need to be quick to outwit your opponents, they are smart and will try to box you in. I wrote this game to prove that writing a game with scrolling scenery is possible even with the limited 6kB of RAM available. I had to compromise sound effects for features, I wanted multiple opponents, I wanted to be able to drop smoke bombs to trap the opponents but all this required memory so the sound effects had to take a back seat.
Assets.h@1:1b8125937f28, 2015-02-01 (annotated)
- Committer:
- taylorza
- Date:
- Sun Feb 01 00:43:25 2015 +0000
- Revision:
- 1:1b8125937f28
- Parent:
- 0:d85c449aca6d
Minor updates
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
taylorza | 0:d85c449aca6d | 1 | #include "SpriteSheet.h" |
taylorza | 0:d85c449aca6d | 2 | |
taylorza | 0:d85c449aca6d | 3 | #ifndef __ASSETS_H__ |
taylorza | 0:d85c449aca6d | 4 | #define __ASSETS_H__ |
taylorza | 0:d85c449aca6d | 5 | |
taylorza | 0:d85c449aca6d | 6 | static Bitmap2bpp spriteSheet(bmp); |
taylorza | 0:d85c449aca6d | 7 | |
taylorza | 0:d85c449aca6d | 8 | static const ImageFrame emptyBlock(spriteSheet, 0, 0, 8, 8); |
taylorza | 0:d85c449aca6d | 9 | static const ImageFrame wallBlock(spriteSheet, 48, 32, 8, 8); |
taylorza | 0:d85c449aca6d | 10 | static const ImageFrame flagBlock(spriteSheet, 48, 40, 8, 8); |
taylorza | 0:d85c449aca6d | 11 | |
taylorza | 0:d85c449aca6d | 12 | static const ImageFrame playerUp(spriteSheet, 0, 0, 16, 16); |
taylorza | 0:d85c449aca6d | 13 | static const ImageFrame playerRight(spriteSheet, 16, 0, 16, 16); |
taylorza | 0:d85c449aca6d | 14 | static const ImageFrame playerDown(spriteSheet, 32, 0, 16, 16); |
taylorza | 0:d85c449aca6d | 15 | static const ImageFrame playerLeft(spriteSheet, 48, 0, 16, 16); |
taylorza | 0:d85c449aca6d | 16 | |
taylorza | 0:d85c449aca6d | 17 | static const ImageFrame enemyUp(spriteSheet, 0, 16, 16, 16); |
taylorza | 0:d85c449aca6d | 18 | static const ImageFrame enemyRight(spriteSheet, 16, 16, 16, 16); |
taylorza | 0:d85c449aca6d | 19 | static const ImageFrame enemyDown(spriteSheet, 32, 16, 16, 16); |
taylorza | 0:d85c449aca6d | 20 | static const ImageFrame enemyLeft(spriteSheet, 48, 16, 16, 16); |
taylorza | 0:d85c449aca6d | 21 | |
taylorza | 0:d85c449aca6d | 22 | static const ImageFrame flag(spriteSheet, 48, 40, 8, 8); |
taylorza | 0:d85c449aca6d | 23 | |
taylorza | 0:d85c449aca6d | 24 | static const ImageFrame smoke(spriteSheet, 0, 48, 16, 16); |
taylorza | 0:d85c449aca6d | 25 | |
taylorza | 0:d85c449aca6d | 26 | static const ImageFrame crash1(spriteSheet, 0, 32, 16, 16); |
taylorza | 0:d85c449aca6d | 27 | static const ImageFrame crash2(spriteSheet, 16, 32, 16, 16); |
taylorza | 0:d85c449aca6d | 28 | static const ImageFrame crash3(spriteSheet, 32, 32, 16, 16); |
taylorza | 0:d85c449aca6d | 29 | |
taylorza | 0:d85c449aca6d | 30 | static const ImageFrame *playerUpAnimation[] = {&playerUp, NULL}; |
taylorza | 0:d85c449aca6d | 31 | static const ImageFrame *playerLeftAnimation[] = {&playerLeft, NULL}; |
taylorza | 0:d85c449aca6d | 32 | static const ImageFrame *playerDownAnimation[] = {&playerDown, NULL}; |
taylorza | 0:d85c449aca6d | 33 | static const ImageFrame *playerRightAnimation[] = {&playerRight, NULL}; |
taylorza | 0:d85c449aca6d | 34 | |
taylorza | 0:d85c449aca6d | 35 | static const ImageFrame *enemyUpAnimation[] = {&enemyUp, NULL}; |
taylorza | 0:d85c449aca6d | 36 | static const ImageFrame *enemyLeftAnimation[] = {&enemyLeft, NULL}; |
taylorza | 0:d85c449aca6d | 37 | static const ImageFrame *enemyDownAnimation[] = {&enemyDown, NULL}; |
taylorza | 0:d85c449aca6d | 38 | static const ImageFrame *enemyRightAnimation[] = {&enemyRight, NULL}; |
taylorza | 0:d85c449aca6d | 39 | |
taylorza | 0:d85c449aca6d | 40 | static const ImageFrame *flagAnimation[] = {&flag, NULL}; |
taylorza | 0:d85c449aca6d | 41 | static const ImageFrame *smokeAnimation[] = {&smoke, NULL}; |
taylorza | 0:d85c449aca6d | 42 | static const ImageFrame *crashAnimation[] = {&crash1, &crash2, &crash3, NULL}; |
taylorza | 0:d85c449aca6d | 43 | |
taylorza | 0:d85c449aca6d | 44 | // Blocks |
taylorza | 0:d85c449aca6d | 45 | static const Block blocks[] = |
taylorza | 0:d85c449aca6d | 46 | { |
taylorza | 0:d85c449aca6d | 47 | Block(&emptyBlock, Block::Background), // 0 - Empty block |
taylorza | 0:d85c449aca6d | 48 | Block(&wallBlock, Block::Solid), // 1 - Wall block |
taylorza | 0:d85c449aca6d | 49 | }; |
taylorza | 0:d85c449aca6d | 50 | |
taylorza | 0:d85c449aca6d | 51 | // Sprites |
taylorza | 0:d85c449aca6d | 52 | static Sprite sprites[] = |
taylorza | 0:d85c449aca6d | 53 | { |
taylorza | 0:d85c449aca6d | 54 | Sprite(playerUpAnimation), // 0 |
taylorza | 0:d85c449aca6d | 55 | Sprite(playerRightAnimation), // 1 |
taylorza | 0:d85c449aca6d | 56 | Sprite(playerDownAnimation), // 2 |
taylorza | 0:d85c449aca6d | 57 | Sprite(playerLeftAnimation), // 3 |
taylorza | 0:d85c449aca6d | 58 | |
taylorza | 0:d85c449aca6d | 59 | Sprite(enemyUpAnimation), // 4 |
taylorza | 0:d85c449aca6d | 60 | Sprite(enemyRightAnimation), // 5 |
taylorza | 0:d85c449aca6d | 61 | Sprite(enemyDownAnimation), // 6 |
taylorza | 0:d85c449aca6d | 62 | Sprite(enemyLeftAnimation), // 7 |
taylorza | 0:d85c449aca6d | 63 | |
taylorza | 0:d85c449aca6d | 64 | Sprite(flagAnimation), // 8 |
taylorza | 0:d85c449aca6d | 65 | Sprite(smokeAnimation), // 9 |
taylorza | 0:d85c449aca6d | 66 | Sprite(crashAnimation), // 10 |
taylorza | 0:d85c449aca6d | 67 | }; |
taylorza | 0:d85c449aca6d | 68 | #endif //__ASSETS_H__ |