Notable PHP packages can be often considered innovative. If this package is also innovative, it can be nominated to the PHP Innovation Award and the author may win prizes and recognition for sharing innovative packages.
If you also developed your own notable or innovative packages consider sharing them, so you can also earn more visibility for your package as well nice prizes.
Login Register. All class groups. Latest entries. Top 10 charts. Recommend this page to a friend! Post a comment See comments 0 Trackbacks 0 Top featured articles Learn more. Skip to content. Here are 14 public repositories matching this topic Language: All Filter by language. Sort options. Star Open Move all text from templates to locale file.
Sponsor Star Updated Jul 3, PHP. PHP game based on Travian, translated to 6 languages. Updated Oct 5, JavaScript. Star 8. Updated Jan 12, PHP. Star 6. Hopefully it will catch your attention enough to see this extension getting traction.
Written in C language, Raylib is defined as "a simple and easy-to-use library to enjoy videogames programming". It offers very straight forward functions to manipulate video, audio, read inputs like keyboard, mouse or gamepads. It also supports 2d and 3d rendering. Is a pretty complete library. Here's an overview of Raylib's architecture. It expects that you'll write your game, engine or tools on top of Raylib's modules. Modules offer features to handle things like camera, textures, text, shapes, models, audio, math….
It doesn't come with engine stuff, like complicated collision detection or physics. If you need such thing, you need to build it yourself. Or find something already written by someone else that is ready to work with Raylib. Recently a PHP extension caught my attention.
Developed by joseph-montanez quite a while ago, the raylib-php extension got its first alpha release less than a month ago. On MacOS the following steps worked fine for me:. It only compiled fine with PHP 7. So make sure you have the appropriate php version. Of course as the C library won't provide game-specific features like physics and others. So such things would have to be developed on PHP side. This extension is not complete yet. Even though it is not complete, I decided to play a bit with it and, as far as I can see, it is already pretty functional.
Even though "Snake" is a simple game I decided not to implement it completely. My main goal here was to have a good enough running engine that would test some basic features from the extension. Should be clear, but is also required that the player would change Snake's direction using an input device, like a keyboard. Two extremely important requirements I chose not to implement were 1 that the Snake should not bite itself.
Meaning that if by any reason Snake hits its own body, the game should be over. And 2 that Snake cannot change immediately to its opposite direction. So when you're heading right, switching to left direction would require to first go up or down. Those two requirements were not implemented as they as purely algorithmic and wouldn't add much to the experimentation of the extension itself.
The game loop is responsible for updating the game state based on user inputs and calculations and later on painting this state on the screen. For this I've created a class named " GameLoop ". The game state holds a snapshot of the game. It holds things like the player's score, the fruit's x,y coordinates, the x,y coordinates from Snake and all squares composing its body.
The GameLoop class initializes the system, and creates a loop that executes two steps on each iteration: update state and draw state. So in the constructor I just initialize the canvas width and height and instantiate the GameState.
0コメント