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: mbed ll16j23s_test_docs
Diff: SnakeBody/SnakeBody.cpp
- Revision:
- 6:6c9453397f4a
- Parent:
- 5:06fa7674622a
- Child:
- 7:dd84e0fab346
--- a/SnakeBody/SnakeBody.cpp Sat May 23 17:16:44 2020 +0000 +++ b/SnakeBody/SnakeBody.cpp Sat May 23 20:01:00 2020 +0000 @@ -8,10 +8,6 @@ _angle = -1.0; _state = 0; _d = 0; - _body_x.clear(); - _body_x.push_back(42); - _body_y.clear(); - _body_y.push_back(24); } SnakeBody::~SnakeBody() @@ -19,8 +15,11 @@ //destructor } -void init(){ - +void SnakeBody::init() { + _body_x.clear(); + _body_x.push_back(42); + _body_y.clear(); + _body_y.push_back(24); } int SnakeBody::update_direction(float _angle, int _x_head, int _y_head) {