Php-Gtk For Games!


GuchaRU

Member
Joined
May 3, 2008
Messages
190
Location
US
Not long ago i discovered PHP-GTK
http://en.wikipedia.org/wiki/PHP-GTK
http://gtk.php.net/
it is "a set of language bindings for PHP which allow GTK+ GUI applications to be written in PHP. PHP-GTK provides an object-oriented interface to GTK+ classes and functions".

writing application with it is really easy if you know php, but i stuck upon some problems...
first - i cant understand how to use expernal libraries. it is needed to play sound in games because there's not a standard sound library.
and second - i cant understand how to use class gdkdrawable (http://gtk.php.net/manual/en/gdk.gdkdrawable.php) this class is needed to draw images and primitives...

also i'm not sure is there a way to compile appications to linus ARM or at least run them under interpreter, but php-gtk supports linux of course.

so if anyone can help me to figure it out i hope i can make some games for pandora!

ps- sorry for my english :)
 
PhonicUK said:
I think I was just sick... PHP for *games* ?
Next thing you know we'll be writing operating systems in Lua...
If you are thinking that php only suited for web development you are mistaken. Of course it will never beat c or delphi but i dont see why it cant be used for simple application for windows or linux.

You can see for yourself:

emuControlCenter - emuControlCenter (ecc) is a rom-manager for retro and new console/computer games. ecc is build for people who want's to play retro games quick 'n' easy, without searching to much, ECC supports images and previews them directy in the 'Resultview'. Also there is a 'ImageCenter' build-in for a fullsize preview!
ecc_main_detail_list.png


here's an another example
FreeTiVi - FreeTiVi is a php-gtk2 front end for mplayer, used to watch TV over DSL using the RTSP streams from french ISP Free.
freeTivi.png


and here is much more

So if you dont want to help then just please don't troll this topic...
 
Last edited by a moderator:
sebt3 said:
I think you are looking for php-sdl instead.
GTK is not very suited for games....
hm... looks interesting but there's not much documentation...
and i dont see a way how it can be run in pandora...
 
Last edited by a moderator:
No reason you can't run a PHP interpreter on Pandora, but PHP really is designed for web development. I'd highly recommend Lua and/or C/C++ for games. (Lua has bindings for GTK, OpenGL, etc as well; they're very easy to make.)
 
⬡ said:
No reason you can't run a PHP interpreter on Pandora, but PHP really is designed for web development. I'd highly recommend Lua and/or C/C++ for games. (Lua has bindings for GTK, OpenGL, etc as well; they're very easy to make.)
Well, the thing is that i dont know C++ or Lua or any other language (except delphi), and i dont have much time to learn it because of work... but i do know php in very high level so... i think it is not bad idea to use it to make simple games.
 
Last edited by a moderator:
GuchaRU said:
⬡ said:
No reason you can't run a PHP interpreter on Pandora, but PHP really is designed for web development. I'd highly recommend Lua and/or C/C++ for games. (Lua has bindings for GTK, OpenGL, etc as well; they're very easy to make.)
Well, the thing is that i dont know C++ or Lua or any other language (except delphi), and i dont have much time to learn it because of work... but i do know php in very high level so... i think it is not bad idea to use it to make simple games.
Well, if you're an inexperienced-in-everything-except-Delphi programmer, there are far better alternatives for you out there.

You could learn processing, for example, which only requires you to learn, say, 5 commands to use efficiently ("size", "stroke", "background", "line", "rect"; there are of course others too) and it's ideal for developing small games (No dependencies, only requires Java to run, can run games in a browser etc). It supports sound, OpenGL, etc through plugins.

Us in the QuantumDrive project used processing to do some demoing (click the processing buttons to load the demos):
http://quantumdrive.dyndns.org/planning/buildingsmodules/45/
 
Last edited by a moderator:
Wow, that is very interesting software, very easy to understand and it looks like platform independent! But could you please tell me how to run it in pandora? Only in browser or there will be way to just run java and the program using java?
 
GuchaRU said:
Wow, that is very interesting software, very easy to understand and it looks like platform independent! But could please you tell me how to run it in pandora? Only in browser or there will be way to just run java and the program using java?
It's a normal Java application that will run anywhere.

Processing will even export your work for you into "nice bundles", for Windows, Linux and Mac OS X. It will spit out 3 folders, and each folder is specialized for that platform, e.g. the Mac OS X folder is a Mac Package that can be installed on Mac, and the Windows version includes an ".exe" file so that Windows users don't have to open the Java application directly.
 
Last edited by a moderator:
Actually. javascript might be a very very good language for games soon too.

v8 (the chrome engine) is completely separate, and there are SDL bindings and the like.

code.google.com/p/lov8/ -- a port of the http://www.love2d.org game engine (which is lua based).


PHP itself is toooooo damn slow to be useful.

(i do php for a living)
 
PHP being stupid with memory ...
http://www.php.net/manual/en/features.gc.performance-considerations.php

it was really designed for short running processes, such as page requests.
 
Back
Top