📘 CodingMarble Learn

Game Engines and Virtual Sport Scenes

A game engine is a program that builds a virtual world from numbers. It places objects, runs physics rules such as gravity, shows the world through a camera, and repeats a loop about 30 or 60 times every second: read input, update the rules, draw the picture. Virtual sport scenes use the same tools to make a court, a ball and players that follow real rules.

🎬 Step-by-step story

  1. An empty digital space. Only a grid. A game engine builds things here.
  2. Add objects: a court, a ball, a player. All are really made of numbers.
  3. Add a physics rule. Gravity pulls the ball down, so it falls and bounces.
  4. Camera: the same court from behind, above or the side. Pick an angle.
  5. The loop: 30 times every second the engine reads input, runs the rules and draws.
  6. Try it: change power and angle, kick the ball and watch the trail.

Tip: drag the 3D scene to turn it. Use two fingers to zoom.

🤔 Common doubts, cleared

Where does the ball come from in a game?

It is built by the engine from numbers: position, size, colour. Step 2.

Why does the ball bounce lower each time?

The rule gives back only part of the speed at each bounce. Watch step 3.

Does changing the camera change the game?

No. The court and ball stay the same; only the view changes. Step 4.

Why do we need so many frames per second?

Many tiny steps look like smooth motion. Step 5 counts frame 1 to 30.

Why does a very high angle not send the ball far?

Most of the speed goes up instead of forward. Try 70° in step 6.

Game engines

A game engine is a set of tools in one program that helps people make games and simulations. Some well-known engines are Unity, Unreal and Godot. You do not need to know their names; you need to know the ideas.

The game loop: how motion appears

A game is not a film. It does not play stored pictures. Instead it draws every picture fresh. It repeats this loop:

  1. Input: read what the player did.
  2. Update (rules): move objects using physics and game rules.
  3. Draw: render the new picture.

Each picture is a frame. How many frames are drawn each second is the frame rate (fps). 30 fps looks smooth, 60 fps looks smoother. At 30 fps one frame lasts about 1/30 of a second.

Virtual sport scenes

A virtual sport scene is a digital court, track or pitch where players and a ball follow the rules of a real sport. Games, training tools and TV graphics use them.

Try it

Use the sliders in the scene: set power high and angle low, kick, then set power low and angle high. Predict first where the ball will land, then check. Which angle goes farthest? Try a middle angle too.

Key formulas and definitions

Worked examples

1. A game runs at 30 fps for 10 seconds. How many frames are drawn?

30 × 10 = 300 frames.

2. How long does one frame last at 60 fps?

1 ÷ 60 ≈ 0.0167 s, about 17 milliseconds.

3. Which camera suits a coach reviewing team shape and why?

Above. It shows where every player stands on the whole court.

4. Name the three jobs in one pass of the loop.

Read input, update objects by the rules, draw the new frame.

Common mistakes

Practice quiz

1. A game engine is…
2. The three jobs of the loop are…
3. At 30 fps, how many frames in 2 seconds?
4. Which camera shows the whole court like a coach?
5. What pulls the virtual ball down?

Practice: answer these yourself

Type or choose your answer, then press Check. Use a hint if you are stuck; the full solution appears after you answer.

Frequently asked questions

What is a game engine?

A program with tools for objects, physics, cameras and drawing that makes games and simulations.

What is a virtual sport scene?

A digital court or pitch where players and a ball follow real sport rules.

What is fps?

Frames per second: how many pictures the game draws each second.

Where this is taught

China八年级(初二)Sem.2 U4 Digital sport

Learn first

Learn next

Related lessons

All Computer Science lessons