U bekijkt momenteel de Netherlands versie van de site.
Wilt u overschakelen naar uw lokale site?
9 MIN LEESTIJD

Coding Zombie Runner with Python

Calvin Robinson creates a custom toolbox for quickly manipulating a custom-built environment, complete with graphical user interface.

QUICK TIP

COLLISION WARNING

QUICK TIP

QUICK TIP

LEVEL EDITOR

PYGAME

We can alter the text of our game in dialog.py – we can go into much deeper detail than just changing the font face, too. Size (down to height and width), background colour, border colour, text position, and frame can all be adjusted.

Our collision detection is pretty basic, but it does the job. Within runngun_classes.pywe have a class set up specifically to calculate if two given shapes have collided:

We’re using free and open source images for our zombie runner game, but you’re welcome to download your own sprite packages, or even better, create your own. In the run_n_gun\ run_n_gun_data directory you’ll find tile sets for the level maps, and animated sprites.

We’d love to see your creations – if you’ve had a go at creating your own sprites and level maps, please share your screenshots with us on Twitter: @linuxformat.

The game engine we’re using comes complete with a comprehensive level editor, so if you’re not a fan of designing levels in arrays there’s a toolset at hand. Execute world_editor.pyto play around with the default level map; we recommend editing levels before creating them from scratch. There’s no obvious key map, so here are the controls:

Credit: https://raytomely.itch.io/run-and-gun

O to change tileset;

OUR EXPERT

Ontgrendel dit artikel en nog veel meer met
Je kunt genieten:
Geniet volledig van deze editie
Direct toegang tot 600+ titels
Duizenden oude edities
Geen contract of verplichting
ABONNEER NU
30 dagen proberen, dan gewoon €11,99 / maand. Op elk moment opzeggen. Alleen nieuwe abonnees.


Meer informatie
Pocketmags Plus
Pocketmags Plus

Dit artikel komt uit...


View Issues
Linux Format
June 2021
IN DE WINKEL BEKIJKEN

Andere artikelen in dit nummer


WELCOME
LINUX FORMAT
MEET THE TEAM
No free lunches
They’re not Google’s photos, they’re mine! To the
REGULARS AT A GLANCE
The right to repair movement gains steam
HARDWARE
Google wins copyright case
COPYRIGHT
Ubuntu working on Windows
OPERATING SYSTEMS
YOUR DATA IS YOURS
Matt Yonkovit is Percona’s Head of Open Source
HORSES & COURSES
OPINION
IBM’s COBOL comes to Linux
PROGRAMMING
Librem 5 progress
HARDWARE
New Android Bluetooth stack
ANDROID
Distro Watch
What’s down the side of the free software sofa?
PANFROST TO VULKAN
OPINION
HERE’S STALLMAN
OPINION
Kernel Watch
Jon Masters summarises the latest happenings in the Linux kernel, so that you don’t have to
Answers
Got a burning question about open source or the kernel? Whatever your level, email it to lxf.answers@futurenet.com
Mailserver
WRITE TO US Do you have a burning
Audacity
Version: 3.0 Web: www.audacityteam.org Hot off the
Clapper
Version: 0.1.0 Web: https://github.com/ Rafostar/clapper A t
Haguichi
Version: 1.4.3 Web: https://github.com/ ztefn/haguichi T ime to
Media Downloader
Version: 1.1.0 Web: https://github.com/ mhogomchungu/media-downloader L ately
Panon
Version: 0.4.6 Web: https://github.com/rbn42/panon C alling all
Radiotray-NG
Version: 0.2.7 Web: https://github.com/ebruck/radiotray-ng W hen it
Dragit
Version: 0.5 Web: https://github.com/ sireliah/dragit F ile sharing
Balla
Version: GIT Web: https://github.com/ TimothyGramnaes/Ball-game C asual browser-based
Command Line Heroes
Version: GIT Web: https://github.com/ CommandLineHeroes/clh-bash H ow many
Pixelorama
Version: 0.8.2 Web: https://github . com/Orama-Interactive/Pixelorama T he
Trash-cli
Version: 0.20.12.26 Web: https:// github.com/andreafrancia/trash-cli A trash can
On the disc
Discover the highlights from this month’s packed DVD!
REVIEWS
Samsung 980 1TB SSD
A strange drive for stranger times, says a perfectly normal  Alan Dexter
Radeon RX 6700 XT
Navi 22 joins the GPU party, trimming core counts, die size and price, as Jarred Walton discovers. If only you could get your hands on it…
Kodachi 8.3
A self-confessed Kodachi fanboy, Mayank Sharma is left speechless by its latest release and doesn’t mind if this review sounds biased (which it is)
Shells.com
Having surrendered most of his existence to the cloud, Mayank Sharma tests a service that might just let him chuck his computer out as well
AlmaLinux OS 8.3
Mayank Sharma is flabbergasted that someone would spend a million dollars to create a community supported clone of a distro
Desperados 3
Management love maverick office types who shoot from the hip, but when Fraser Brown did it they were ducking for cover!
ROUNDUP
Web browsers
Default web browsers are fine, but there’ll come a time when you’ll demand more from your online tools. Shashank Sharma presents five contenders
ESCAPE GOOGLE PHOTOS
Google’s free photo storage is a thing of the past. Jonni Bidwell has some free software to get your albums in order
Free your photos
Whether at home or in the cloud, your photos deserve a new host
Install Nextcloud
Discover how you can tap into the power of Docker Compose to get Nextcloud up and running in a jiffy just like the professionals
Transfer your photos
Now that Nextcloud is installed and operational, it’s time to get your photos into it, and out of reaching distance from Google
Let’s look at Lychee
Get simply beautiful photo hosting with a tropical, fruity aftertaste
IN-DEPTH
OPENSTREETMAP TURNS ONE HUNDRED MILLION!
Google Maps isn’t the only mapping tool on the block. One alternative in particular, OpenStreetMaps, employs an open crowd-sourcing approach, as Mike Bedford reveals
GET INTO GENTOO
Famed as the fastest penguin on the planet, Mats Tage explains how you to can use it to run the fastest of Tux boxes
Pi USER
BITTEN BY THE Pi BUG
Andy Piper is a senior staff developer advocate
Pi 5 confirmed and the Pico’s name
Eben Upton confirms the Pi 5, another Pico and what the model number actually means
AdaFruit ItsyBitsy
Teeny weeny Pico bikini
Plant your Pico
Seeed maker base
Inky Impression
Les Pounder enjoys pop art and eight-bit computers, so this new screen from Pimoroni is an ideal way to display his favourite style of art
Building code for microcontrollers
CIRCUITPYTHON
Build your own URL shortening service
WEB APPLICATION
TUTORIALS
System boot speeds
While Shashank Sharma doesn’t much care for cars that can go 0-60 in six seconds or less, he does expect his distro to boot up in no time at all
Administer servers with your browser
Nick Peers reveals how to use Cockpit to access and manage your headless server remotely – no keyboard or display required
Model and render objects in Blender
We love tea at Linux Format Towers – even that fancy herbal stuff – so Michael Reed is going to show you how to make a lovely cuppa… in Blender
Emulating the Commodore PET
Les Pounder relives a time when a roguish smuggler who looked a lot like Harrison Ford shot first and your computer was ready to code in seconds!
Protecting documents with security tools
Kseniya Fedoruk applies digital signatures, passwords and watermarks, to ensure extra security when working with documents in OnlyOffice
Explore Forth on the Jupiter Ace
Mike Bedford reveals the Jupiter Ace, the contemporary of the Sinclair ZX81 that was programmed in Forth rather than the more popular BASIC
CODING ACADEMY
Collect and graph metrics with Python
PROMETHEUS
Chat
X
Pocketmags ondersteuning