added collisions
This commit is contained in:
+1
-1
@@ -95,7 +95,7 @@ int main() {
|
||||
player.set_velocity_y(player.get_velocity().y + player.m_acceleration);
|
||||
player.rect.move({0, player.get_velocity().y});
|
||||
|
||||
test_square.set_velocity_y(player.get_velocity().y + 1);
|
||||
test_square.set_velocity_y(test_square.get_velocity().y + 1);
|
||||
if(test_square.get_velocity().x > 0) {
|
||||
test_square.set_velocity_x(test_square.get_velocity().x - 1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user