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.
Engine/engine.cpp@3:31ff7b3e2005, 2020-05-15 (annotated)
- Committer:
- Neowless
- Date:
- Fri May 15 20:32:27 2020 +0000
- Revision:
- 3:31ff7b3e2005
- Parent:
- 2:cc9d8ec2e1f4
test;
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| Neowless | 1:48b0bf0bcda8 | 1 | #include "engine.h" |
| Neowless | 1:48b0bf0bcda8 | 2 | |
| Neowless | 1:48b0bf0bcda8 | 3 | |
| Neowless | 1:48b0bf0bcda8 | 4 | void engine::init(){ |
| Neowless | 1:48b0bf0bcda8 | 5 | } |
| Neowless | 1:48b0bf0bcda8 | 6 | |
| Neowless | 3:31ff7b3e2005 | 7 | events engine::event_check(chara &p, obs &b, Gamepad &pad){ |
| Neowless | 1:48b0bf0bcda8 | 8 | xy pxy = p.getxy(); |
| Neowless | 1:48b0bf0bcda8 | 9 | if(b.x>-1){ |
| Neowless | 3:31ff7b3e2005 | 10 | if(((pxy.x - b.width < b.x)&&(pxy.x+7>b.x)) &&((pxy.y-b.height<b.y)&&(pxy.y+8>b.y))){ |
| Neowless | 1:48b0bf0bcda8 | 11 | return DEAD; |
| Neowless | 1:48b0bf0bcda8 | 12 | } |
| Neowless | 1:48b0bf0bcda8 | 13 | } |
| Neowless | 1:48b0bf0bcda8 | 14 | return NONE; |
| Neowless | 1:48b0bf0bcda8 | 15 | } |
| Neowless | 1:48b0bf0bcda8 | 16 | |
| Neowless | 1:48b0bf0bcda8 | 17 | |
| Neowless | 2:cc9d8ec2e1f4 | 18 | int engine::randomobs(){ |
| Neowless | 2:cc9d8ec2e1f4 | 19 | int y = (rand() % (31))+ 5; |
| Neowless | 1:48b0bf0bcda8 | 20 | return y; |
| Neowless | 1:48b0bf0bcda8 | 21 | } |
| Neowless | 1:48b0bf0bcda8 | 22 | |
| Neowless | 1:48b0bf0bcda8 | 23 |