Author Archives: Ryan Lambie

Coding Breakout’s brick-breaking action | Wireframe #11

via Raspberry Pi

Atari’s Breakout was one of the earliest video game blockbusters. Here’s how to recreate it in Python.

The original Breakout, designed by Nolan Bushnell and Steve Bristow, and famously built by a young Steve Wozniak.

Atari Breakout

The games industry owes a lot to the humble bat and ball. Designed by Allan Alcorn in 1972, Pong was a simplified version of table tennis, where the player moved a bat and scored points by ricocheting a ball past their opponent. About four years later, Atari’s Nolan Bushnell and Steve Bristow figured out a way of making Pong into a single-player game. The result was 1976’s Breakout, which rotated Pong’s action 90 degrees and replaced the second player with a wall of bricks.

Points were scored by deflecting the ball off the bat and destroying the bricks; as in Pong, the player would lose the game if the ball left the play area. Breakout was a hit for Atari, and remains one of those game ideas that has never quite faded from view; in the 1980s, Taito’s Arkanoid updated the action with collectible power-ups, multiple stages with different layouts of bricks, and enemies that disrupted the trajectory of the player’s ball.

Breakout had an impact on other genres too: game designer Tomohiro Nishikado came up with the idea for Space Invaders by switching Breakout’s bat with a base that shot bullets, while Breakout’s bricks became aliens that moved and fired back at the player.

Courtesy of Daniel Pope, here’s a simple Breakout game written in Python. To get it running on your system, you’ll first need to install Pygame Zero. And download the code for Breakout here.

Bricks and balls in Python

The code above, written by Daniel Pope, shows you just how easy it is to get a basic version of Breakout up and running in Python, using the Pygame Zero library. Like Atari’s original, this version draws a wall of blocks on the screen, sets a ball bouncing around, and gives the player a paddle, which can be controlled by moving the mouse left and right. The ball physics are simple to grasp too. The ball has a velocity, vel – which is a vector, or a pair of numbers: vx for the x direction and vy for the y direction.

The program loop checks the position of the ball and whether it’s collided with a brick or the edge of the play area. If the ball hits the left side of the play area, the ball’s x velocity vx is set to positive, thus sending it bouncing to the right. If the ball hits the right side, vx is set to a negative number, so the ball moves left. Likewise, when the ball hits the top or bottom of a brick, we set the sign of the y velocity vy, and so on for the collisions with the bat and the top of the play area and the sides of bricks. Collisions set the sign of vx and vy but never change the magnitude. This is called a perfectly elastic collision.

To this basic framework, you could add all kinds of additional features: a 2012 talk by developers Martin Jonasson and Petri Purho, which you can watch on YouTube here, shows how the Breakout concept can be given new life with the addition of a few modern design ideas.

You can read this feature and more besides in Wireframe issue 11, available now in Tesco, WHSmith, and all good independent UK newsagents.

Or you can buy Wireframe directly from us – worldwide delivery is available. And if you’d like to own a handy digital version of the magazine, you can also download a free PDF.

Make sure to follow Wireframe on Twitter and Facebook for updates and exclusives, and for subscriptions, visit the Wireframe website to save 49% compared to newsstand pricing!

The post Coding Breakout’s brick-breaking action | Wireframe #11 appeared first on Raspberry Pi.

Wireframe 2: The Blackout Club, Battlefield V anxiety, and more

via Raspberry Pi

Momentum firmly established, we’re back with our brilliant second issue of Wireframe — the magazine that lifts the lid on video games.

And yes, we are continuing to write ‘video games’ as two words.

Blacking out

In our sophomore edition, you’ll discover all manner of great features, guides, reviews, and everything else you could wish for. In an exclusive interview, BioShock 2 director Jordan Thomas talks about The Blackout Club, his new co-operative horror game – which also features on our fantastic front cover! With inspiration coming from the likes of Stranger Things, you just know The Blackout Club is going to be something special.

We also hear from Battlefield V’s Creative Director Lars Gustavsson in a candid discussion about his own personal excitement — and apprehension — surrounding the launch of DICE’s latest in its nearly 20-year-old series.

And a lot more

Is that all? Of course not. Thomas Was Alone and Subsurface Circular creator Mike Bithell shares his personal perspective on the ever-changing shape of video games.

Issue 2 also takes an extended look at an RPG’s journey from tabletop to screen: it’s not easy to bring the likes of Cyberpunk 2020 to the world of video games, and CD Projekt Red, Chris Avellone, and others tell us just why that is.

We’re just spoiling you now, but there’s plenty more besides, such as:

  • The maths behind matchmaking and video game economics
  • The changing face of Mega Man, an enduring 8-bit icon
  • An indie game’s path from Japanese restaurant to Nintendo eShop
  • The simple yet effective AI behind Galaxian’s angry aliens

All of this is joined by news, previews, and reviews of everything gaming has to offer.

Buy Wireframe issue 2

Physical copies of Wireframe are available now in WHSmith, Tesco, and all good independent UK newsagents. Of course, we don’t like to limit your choices, so you’re able to buy direct from us, with worldwide delivery available.

There’s also the option to download issue 2 a free PDF if you’d like a handy digital version.

Subscription options!

Fancy putting your feet up and letting Wireframe come directly to you? In that case, you should take a look at our subscription options: pick up a sample six issues for a bargain price, subscribe for a full year, or get the digital edition directly to your smart device via our Android and iOS apps. To find out how to save up to 49% on Wireframe’s print edition, head to wfmag.cc/subscribe.

wireframe magazine

See you again in two weeks!

A wild HackSpace magazine appeared

HackSpace magazine issue 13 is also out today, and it’s pretty sweet. Check it out here!

HackSpace issue 13 front cover

The post Wireframe 2: The Blackout Club, Battlefield V anxiety, and more appeared first on Raspberry Pi.

Wireframe issue 1 is out now!

via Raspberry Pi

Wireframe is our new twice-monthly magazine that lifts the lid on video games. In Wireframe, we look at how games are made, who makes them, and how you can make games of your own. And today, we’re releasing our very first issue!

Wireframe: the new magazine that lifts the lid on video games

Uploaded by Raspberry Pi on 2018-11-07.

The inaugural issue

In issue 1, Far Cry 4 director Alex Hutchinson talks to us about going indie. We look back at the British games industry’s turbulent early years; we explore how curves and probabilities shape the games we play; and we get hands-on with Nomada Studio’s forthcoming ethereal platformer, Gris.

Wireframe magazine

Plus:

  • Jessica Price on the state of game criticism
  • Portal squeezed onto the Commodore 64
  • Treasure — the iconic game studio at 25
  • Gone Home’s Kate Craig on indie game design workarounds
  • And much, much more…

About Wireframe magazine

Cutting through the hype, Wireframe takes a more indie-focused, left-field angle than traditional games magazines. As well as news, reviews, and previews, we bring you in-depth features that uncover the stories behind your favourite games.

Wireframe magazine

And on top of all that, we also help you create your own games! Our dedicated Toolbox section is packed with detailed tutorials and tips to guide you in your own game development projects.

wireframe issue 1 cover

Raspberry Pi is all about making computing accessible to everyone, and in Wireframe, we show you how programming, art, music, and design come together to make the video games you love to play — and how you can use these elements to build games yourself.

Free digital edition

We want everyone to enjoy Wireframe and learn more about creating video games, so from today, you’ll also be able to download a digital copy of issue 1 of Wireframe for free. Get all the features, guides, and lively opinion pieces of our paper-and-ink edition as a handy PDF from our website.

Wireframe in the wild

You can find the print edition of Wireframe issue 1 in select UK newsagents and supermarkets from today, priced at just £3. Subscribers also save money on the cover price, with an introductory offer of twelve issues for just £12.

For more information, and to find out how to order Wireframe from outside the UK, visit wfmag.cc.

The post Wireframe issue 1 is out now! appeared first on Raspberry Pi.