~/talk

Video Games in PHP πŸ‘Ύ: from the game loop to collisions

TalkinItalianat phpday PUG Edition 2022 Β· on Monday, 2022-04-11Β· [php, creative-coding]
slides:none on file

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

  1. 0:00Introduction
  2. 8:37Rendering a window
  3. 12:22The rectangle
  4. 14:33The texture
  5. 17:05The game loop
  6. 22:42Collisions
  7. 27:46Joystick
  8. 30:16SDLMix
  9. 31:05Art for video games in PHP
  10. 33:05Questions
  11. 33:49Closing remarks
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark β€” the status bar button does the same
?
this help
esc
close this, then clear every filter β€” or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.