From 7a60ab9f178dd813c876fcf8e25c947f9a9a5e06 Mon Sep 17 00:00:00 2001 From: Simponic Date: Tue, 30 Jun 2020 20:04:55 -0600 Subject: Updated indentation --- flyingObject.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 flyingObject.cpp (limited to 'flyingObject.cpp') diff --git a/flyingObject.cpp b/flyingObject.cpp new file mode 100644 index 0000000..149e3f5 --- /dev/null +++ b/flyingObject.cpp @@ -0,0 +1,20 @@ +#include "flyingObject.h" +#include + +// Advance flyingobjects +void FlyingObject::advance() +{ + point.addX( getVelocity().getDx() ); + point.addY( getVelocity().getDy() ); + + if ( point.getX() > 200 ) + point.setX( -200 ); + else if ( point.getX() < -200 ) + point.setX( 200 ); + + if ( point.getY() > 200 ) + point.setY( -200 ); + else if ( point.getY() < -200 ) + point.setY( 200 ); + +} -- cgit v1.2.3-70-g09d2