Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: N5110 PinDetect PowerControl mbed
Enemy.cpp
00001 #include "Enemy.h" 00002 00003 /// @file Enemy.cpp 00004 00005 /// Setup the enemy based on type 00006 void Enemy::setup() 00007 { 00008 switch (type) 00009 { 00010 case SIMPLE: 00011 width = 5; 00012 height = 5; 00013 vx = 1; 00014 difficulty = 1; 00015 jumpRate = 3; 00016 break; 00017 00018 case JUMPER: 00019 width = 3; 00020 height = 4; 00021 vx = 1; 00022 difficulty = 3; 00023 jumpRate = 50; 00024 break; 00025 00026 case RUNNER: 00027 width = 6; 00028 height = 5; 00029 vx = 2; 00030 difficulty = 5; 00031 jumpRate = 0; 00032 break; 00033 00034 default: // error, should not be possible 00035 width = height = vx = vy = 0; 00036 } 00037 00038 if (facingLeft) 00039 vx *= -1; 00040 }
Generated on Tue Jul 12 2022 21:59:47 by
1.7.2