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.
Diff: Engine/engine.cpp
- Revision:
- 2:cc9d8ec2e1f4
- Parent:
- 1:48b0bf0bcda8
- Child:
- 3:31ff7b3e2005
--- a/Engine/engine.cpp Fri May 15 12:32:47 2020 +0000 +++ b/Engine/engine.cpp Fri May 15 17:44:25 2020 +0000 @@ -4,11 +4,7 @@ void engine::init(){ } -void engine::fire(int x,int y, bullet &b){ - b.x = x; - b.y = y; -} -events engine::evet_check(plane &p, bomb &b, Gamepad &pad, bullet &bu){ +events engine::evet_check(chara &p, obs &b, Gamepad &pad){ xy pxy = p.getxy(); int width = p.getwidth(); int height = p.getheight(); @@ -17,22 +13,12 @@ return DEAD; } } - if(pad.get_direction() == N){ - return FIRE; - } - if(bu.x>-1&&b.x>-1){ - if(((bu.x - b.width < b.x)&&(bu.x+2>b.x)) &&((bu.y-b.height<b.y)&&(bu.y+2>b.y))){ - return ELMININATE; - } - } return NONE; } -int engine::randombomb(){ - int a = 5; - int b = 35; - int y = (rand() % (b-a+1))+ a; +int engine::randomobs(){ + int y = (rand() % (31))+ 5; return y; }