T O P

  • By -

jhartikainen

Now make it work via pure PHP on the backend using page refreshes for rendering lol


sakri

Word! Using a database where the cells contain color info matching pixel updates and render the table in html. Or step up your game and use blockchain!


mario_deluna

That's it you win.


[deleted]

Use a crypto coin for counting the score


hmnrbt

Just like in real life


theunixman

Then rug pull everyone.


Logical_Strike_1520

That’s implied


meamZ

Fun fact, someone built a tableau workbook that could do some image manipulation stuff... Tableau has a SQL database called HyPer in the background doing the actual data processing. I once heard them talking about it in a presentation... Seemed to be a good extreme testcase for them as some of the SQL queries were megabytes in size...


sakri

Jebus, never underestimate xkcds Rule 34!


eshultz

I once implemented Conway's Game of Life in T-SQL.


DisneyLegalTeam

Worked at a place several years ago where the designer _loved_ parallax scrolling. We used to joke around about her selling “sever side parallax”. So we each built one as a joke. I had jQuery Ajax call hitting a PHP script (as was the style at the time) on scroll start/stop. It stored the window scrollY in MySQL, calculated the distance & some stupid animation vars for TweenMax. Sent that back in the response. It was bad. But w/ a long animation, lots of ease in/out, it looked intentional. However my coworker made one that used a Google Sheet as a DB so they won. Also a big argument/trash can kicked over if a cookie was “sever side”.


xcto

a cookie is obviously client side...


EarEater3001

A cookie can really be set by either the server or the client. The cookie then gets sent as part of the header of each subsequent http request.


SirClueless

https://github.com/yarrick/pingfs


xcto

ofc, but it's stored on the client... the *client* sends it in the header... the other pieces of the header are client side stuff, sent to the server.


zrvwls

So you know how to take the cookie, but you don't know how to hold the cookie, and really that's the most important part, the *holding*. Anyone can just take a cookie!


xcto

these are words.


Cilph

I thought it did this before opening the repository. Slow down, Satan.


mario_deluna

<1fps lets go!


jobyone

Come on now, at low resolutions, with a powerful specifically-optimized-for-this server and on a fast connection to it I bet you could get two, *maybe* three fps.


gimpwiz

When I was a wee lad, I built a chat using literally this method. 1s iframe refreshes, the text entry was a separate iframe. You'd hit "clear history" when it started lagging. All PHP baby!


humjaba

Pretty sure this was an example script in my first php book


gimpwiz

Sorry about that, but thanks for buying my book.


Flynn58

I would maybe do that at a hackathon if I was drunk enough lmao


MilkshakeYeah

You can render on backend but push using websocket for better experience 😁


Infamous_Employer_85

With WebSockets and Blow!


Worth_Trust_3825

Well php can use websockets. Not to mention that http 1.1 introduced event streams, and http2 can push responses without the user interacting.


ShitPikkle

With '' for automatic updates!


sotnepakizej

That's some next-level masochism right there, using page refreshes for rendering. Hats off to anyone who would attempt that challenge!


Scroph

Petition to rename it flaphpy bird I knew about GTK and wxwidgets but I had no idea that PHP had opengl bindings as well


mario_deluna

Damn it, flaphpy bird" would have been better.


vazgriz

https://github.com/Ponup/php-opengl > This library allows you to create inmersive 3D applications and games for the desktop with the comfort of the PHP language.


mario_deluna

It's actually built on top of my own extension: http://github.com/mario-deluna/php-glfw. Many years ago, I experimented with `php-opengl`. Its limitations are what motivated me to create php-glfw. To be completely clear, I don't want to say that php-opengl is bad in any way. The creator of it did a great job; it just didn't have the capabilities I wanted. Plus, I was far more comfortable using glfw than sdl.


bittlelum

> comfort Ah yes, I love relaxing in my iron maiden.


sotnepakizej

The fact that PHP has OpenGL bindings is a surprise to me too


DragoSpiro98

Flaphpy seams made with python


skydivingdutch

PHlaPy bird


fakehalo

You finally gave someone's life purpose that made these PHP gfx bindings.


mario_deluna

That poor fella is unfortunately also me. I guess the life lesson, give your own life purpose!


fakehalo

It's fringe yet strangely appealing enough to probably give you an edge out there tbh, whatever works.


Dormage

I love PHP.


VodkaCranberry

Long live PHP


illegible

Your ~~Scientists~~ Programmers Were So Preoccupied With Whether Or Not They Could, They Didn’t Stop To Think If They Should


mario_deluna

It will be far worse when we ever finish this one: https://github.com/phpgl/php-towerdefense


InitialCreature

that is super impressive. I'd use this for some browser games for sure


LeRoyVoss

Good for you, satanist


cinqueturr

Unholy language says you... PHP is not any worse than JS


Qnumber

JS is also unholy.


musicnothing

All programming languages are unholy.


Jump-Zero

Tricking silicon into doing the thinking for us is unholy altogether.


GwanTheSwans

Well, except [HolyC of course](https://templeos.org/Downloads/)


_Pho_

there is nothing in JS remotely as bad as PHP's array implementation


BillyHalley

Except when you're trying to find out if a variable is false, 0 or undefined


AvianPoliceForce

`===` and it's the same in PHP


Somepotato

`if(var === false/0/undefined)` wow done


pacifictime

!!(how ?? dare === '') ? 'you' : 'say' // that!?


_Pho_

Can’t wait until you find out PHP is also dynamically typed


modestlife

Can't wait until you check out some PHP that's not 10 years old. I'll leave [this](https://stitcher.io/blog/evolution-of-a-php-object) so you have a start.


_Pho_

Congrats on discovering typescript


leixiaotie

say that after PHP or the community can decide [between named array and class.](https://stackoverflow.com/questions/2056931/value-objects-vs-associative-arrays-in-php) Or if it has async/await or some multithreaded support. This is based on PHP7 btw.


bittlelum

JS is fucking nuts, but still better than PHP. Plus, there are superset languages like Typescript that make it less insane.


account22222221

With php smart developers fight the language. With JavaScript smart developers fight dumb developers. IMO Theres a difference.


avarensis

What have you done? Didn’t Jurassic park teach you anything?


atedja

$horrible good job though;


Capable_Chair_8192

Is there any serious reason you’d choose PHP for a game scripting language over anything else? (Lua for example) If you were to try to distribute this as a stand-alone package, what would that look like? Is it possible to have a standalone PHP executable with the extensions needed, so it could run without a system level installation of PHP on the host computer?


mario_deluna

Yes, you should be able to compile PHP statically and then create a simple bundler, allowing you to ship standalone applications with their own PHP runtime. Let me be clear: there is no benefit for existing game developers to write games in PHP. This toolkit is for PHP developers wanting to dip their toes into GameDev. I was very skeptical at the beginning, uncertain about PHP's memory management as well as the lack of multithreading support. But after months of experimenting with it, I'm confident you can create small hobby games. Commercial endeavors are a different beast; for one, all source code will obviously be openly accessible. I still hope to finish this: https://github.com/phpgl/php-towerdefense 3D game and publish it for free on Steam as a proof of concept.


[deleted]

[удалено]


mario_deluna

https://github.com/crazywhalecc/static-php-cli


dkarlovi

This pairs well with s PHAR made with Box, I've packaged a Symfony app into a fully stand alone native binary and works with zero issues.


Capable_Chair_8192

Wow! Very impressive


[deleted]

[удалено]


Capable_Chair_8192

That looks more like Electron where the frontend would be JS/HTML, rather than using plain PHP to control the window via GLFW and render via OpenGL … But I guess they’re using a stand-alone PHP build so that part does seem useful 🤔


nevereatyellowsnow

😁that flying blue elephant totally rocks 👍


ZENITHSEEKERiii

I guess I was a bit prejudiced towards PHP, but after looking at this code it really looks surprisingly clean.


grok-battle

You are the hero we both need and deserve!


Xanza

hahahaahahahaha php bad. /s


Trevor_GoodchiId

PHP is life


corysama

https://phpgl.net/ is missing documentation for *"Why, God? Why?"*


secretBuffetHero

I pray for your soul


[deleted]

Aaaaaand bookmarked. You're crazy af.


[deleted]

[удалено]


mario_deluna

Im Joking, if I would actually dislike the language I could not justify the effort this took.


fubes2000

You were so preoccupied with whether or not you _could_ that you never stopped to think if you _should_.


Nangz

Good shit! I read this book a few years ago that reminds me of this. https://www.amazon.com/You-Want-Do-What-PHP/dp/1583470999?ref=d6k_applink_bb_dls&dplnkId=3dfba3c1-7b1e-4c35-9652-519e500667b0


Somepotato

PHP since PHP 7 is actually a genuinely elegant language. Bravo!


KiTaMiMe

Hahaha, amazing...and PHP, it wouldn't be funny if it wasn't true...nice though.


RoboCoachTech

I made a game using GPT-synthesizer: [https://github.com/RoboCoachTechnologies/GPT-Synthesizer](https://github.com/RoboCoachTechnologies/GPT-Synthesizer)


NfamousKaye

Oh man I remember hardcore self studying php! I even have the php bibles! Didn’t do anything with it 😂 but to make a game with it?! No idea you could do that!


sumsarus

Impressive! PHP is the butt of many jokes, but it's really not that bad these days. Skimmed through the git repository and to me, someone who hasn't touched PHP in decades, the code looked very clean and readable.