Video Games in PHP πΎ: from the game loop to collisions
summary
A runnable PHP game stack built with SDL is presented, using the SDL, SDL_image and SDL_mixer PHP extensions to create a window, renderer, textures and sprite drawing via renderCopy/renderCopyEx plus image and audio support. It covers a real game loop using delta time for consistent motion, input handling for keyboard and joystick (including rumble), and collision detection/resolution using AABB intersection with intersection-rect resolution. Concrete performance numbers are given (~600β650 fps with ~100 objects; ~200 fps on a 2017 MacBook Pro with 40 objects).
AI-written summary Β· about
chapters (11)
- 0:00Introduction
- 8:37Rendering a window
- 12:22The rectangle
- 14:33The texture
- 17:05The game loop
- 22:42Collisions
- 27:46Joystick
- 30:16SDLMix
- 31:05Art for video games in PHP
- 33:05Questions
- 33:49Closing remarks
related talks
28mMaking Games
37mWhat if you used PHP to code games on your favorite console?
57mGame Programming with Python
25mJavascript as Play A Primer on Getting Started with Video Games
51mWriting Games with Ruby
51mWriting Games with Ruby
26mdeveloping videogames in JavaScript
38mGraphics and Simulations (and Games), Oh My!
