Skip to content
Snippets Groups Projects
Commit 0da9a2a5 authored by Joakim Hunskaar's avatar Joakim Hunskaar
Browse files

new øving6 using color not colour

parent df3a5a68
No related branches found
No related tags found
No related merge requests found
No preview for this file type
...@@ -25,8 +25,8 @@ void bouncingBall(){ ...@@ -25,8 +25,8 @@ void bouncingBall(){
const int radius{30}; const int radius{30};
int alpha{1}; int alpha{1};
int velocity{2}; int velocity{2};
Color colour_up{Color::blue}; Color color_up{Color::blue};
Color colour_down{Color::blue}; Color color_down{Color::blue};
int x{0}; int x{0};
int y{360}; int y{360};
int increment_x{0}; int increment_x{0};
...@@ -45,8 +45,8 @@ void bouncingBall(){ ...@@ -45,8 +45,8 @@ void bouncingBall(){
// initialise the run // initialise the run
velocity = slow.velocity; velocity = slow.velocity;
colour_up = ball_colour.at(slow.colour_up); color_up = ball_color.at(slow.color_up);
colour_down = ball_colour.at(slow.colour_down); color_down = ball_color.at(slow.color_down);
while (!window.should_close()) { while (!window.should_close()) {
// determine increments based on the velocity // determine increments based on the velocity
...@@ -63,12 +63,12 @@ void bouncingBall(){ ...@@ -63,12 +63,12 @@ void bouncingBall(){
if (count_num_passes % 2 == 0) { if (count_num_passes % 2 == 0) {
if (velocity == slow.velocity) { if (velocity == slow.velocity) {
velocity = fast.velocity; velocity = fast.velocity;
colour_up = ball_colour.at(fast.colour_up); color_up = ball_color.at(fast.color_up);
colour_down = ball_colour.at(fast.colour_down); color_down = ball_color.at(fast.color_down);
} else { } else {
velocity = slow.velocity; velocity = slow.velocity;
colour_up = ball_colour.at(slow.colour_up); color_up = ball_color.at(slow.color_up);
colour_down = ball_colour.at(slow.colour_down); color_down = ball_color.at(slow.color_down);
} }
} }
} else { } else {
......
...@@ -8,7 +8,7 @@ struct Config{ ...@@ -8,7 +8,7 @@ struct Config{
// END: 4a // END: 4a
}; };
extern map<int, Color> ball_colour; extern map<int, Color> ball_color;
istream& operator>>(istream& is, Config& cfg); istream& operator>>(istream& is, Config& cfg);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment