'F' → Fullscreen
You will make one small program, then refactor yesterday's traffic signal without changing its appearance.
template-game.1-03-circle.circleX, circleY, and radius above the Raylib setup.circleX to 150 and run again.radius and describe what stays fixed.using Raylib_cs;
int screenWidth = 800;int screenHeight = 600;
int circleX = 400;int circleY = 300;int radius = 40;
Raylib.InitWindow(screenWidth, screenHeight, "One Circle");Raylib.SetTargetFPS(60);
while (!Raylib.WindowShouldClose()){ Raylib.BeginDrawing(); Raylib.ClearBackground(Color.Black);
Raylib.DrawCircle(circleX, circleY, radius, Color.SkyBlue); Raylib.EndDrawing();}
Raylib.CloseWindow();1-02-signal folder.1-03-signal.lightX, lightY, radius, and gap above the setup.using Raylib_cs;
int screenWidth = 800;int screenHeight = 600;
int lightX = 400;int lightY = 190;int radius = 35;int gap = 110;
Raylib.InitWindow(screenWidth, screenHeight, "Traffic Signal");Raylib.SetTargetFPS(60);
while (!Raylib.WindowShouldClose()){ Raylib.BeginDrawing(); Raylib.ClearBackground(Color.Black);
Raylib.DrawRectangle(lightX - 50, lightY - 60, 100, 340, Color.Gray); Raylib.DrawCircle(lightX, lightY, radius, Color.Red); Raylib.DrawCircle(lightX, lightY + gap, radius, Color.Yellow); Raylib.DrawCircle(lightX, lightY + gap * 2, radius, Color.Green);
Raylib.EndDrawing();}
Raylib.CloseWindow();The rectangle uses lightX - 50 because rectangles are placed by a corner while circles are placed by their centers.
lightX and run.lightY and run.int lightX = 650;int lightY = 125;int radius = 30;int gap = 95;int variable can only store whole numbers.int score = 0;score = "ten";error CS0029: Cannot implicitly convert type 'string' to 'int'lightX to lowercase lightx.Raylib.DrawCircle(lightx, lightY, radius, Color.Red);error CS0103: The name 'lightx' does not exist in the current contextThe AP exam uses an arrow for assignment. It does not include C#'s type declaration because the exam notation does not declare types.
int lives = 3;lives = lives - 1;Console.WriteLine(lives);lives β 3lives β lives - 1DISPLAY(lives)On the exam, = means βis equal to.β In C#, = is assignment. The comparison operator arrives later.
Test your final 1-03-signal program:
lightX alone moves all four shapes left or right.lightY alone moves all four shapes up or down.radius changes all three lights.gap changes the spacing between the lights.Answer the following questions before submitting your work.
score holds 40, explain how C# evaluates score = score + 10; and state the final value.int score = 0; not later store the text "ten"?Submit your completed activity sheet. Keep 1-03-circle and 1-03-signal in your workspace.