Jump to content

Basic Tutorial - Blitz

; 3. Collisions (Top/Bottom walls) If ball_y < 5 Or ball_y > 595 Then ball_dy = -ball_dy

First, put a file called boop.wav in your project folder.

; 6. Drawing Color 255, 255, 255 Rect 10, p1_y, 15, 60, True ; Left Paddle Rect 775, p2_y, 15, 60, True ; Right Paddle Oval ball_x, ball_y, 10, 10, True ; Ball blitz basic tutorial

For p.Player = Each Player ; Draw or update p Next Let's tie it all together into a 2-player Pong game. No AI, just two paddles and a ball.

Spoiler: It wasn't lying.

Cls

; Keep ball on screen (Boundaries) If x < 0 Then x = 0 If x > 768 Then x = 768 If y < 0 Then y = 0 If y > 568 Then y = 568 Drawing Color 255, 255, 255 Rect 10, p1_y,

For this tutorial, I am using (Windows only, but runs perfectly on Linux/Wine).

Cls clears. Flip displays. If you forget Flip , you see nothing. If you forget Cls , you get a messy "light trail" effect. 3. Your First Moving Pixel (A Ball) Let’s make a red ball bounce across the screen. We need variables for position ( x ) and speed ( dx ). Cls ; Keep ball on screen (Boundaries) If

×
×
  • Create New...