+ 30
Can a game be made using PHP??
18 Respuestas
+ 19
thanks everyone for your suggestions
+ 7
If you want to travel from New Delhi to Mumbai, you can do so by taking flight, train, bus, car, bicycle, walking and so on.. However, if you choose to travel by walking it definitely won't be a smart choice so, you will consider either flight or train.
Similarly, almost every programming language is capable to do almost everything that any particular programming language can do. However, there are few languages which makes certain tasks easier for the programmer and hence are preferred. So yes, you can make games in PHP but you have other better and powerful options for this purpose.
Hope this will help.
Ashish
+ 7
yes, but PHP is not meant for that!, you d be able to do so less,
try exploring canvas in HTML5 with js,
any good graphics library with C++ or java
swift.
if it's js u pick , then there are tons of resources here
+ 4
PHP is not used to create games. It is used for server-side programming on websites. You can probably create a basic game of Tic Tac Toe with PHP, but you cannot create big games (Call of Duty, etc.).
+ 3
yes, need to learn and learn
+ 3
@Ashish
Thanks✅✅✅
+ 2
Depends on the complexity of the game
+ 2
I am thinking we can do
+ 2
PHP is a server side language. You would use it for important parts like tracking the count of gold or general player statistics. You cannot use it to create games though. Once the players gets something sent to their browser, the PHP script closes.
+ 1
a game I think ... if we make ,it is not interesting ...
+ 1
but your query is very nice. .. beound the things
+ 1
What you by saying game? It depends
mostly best games are made by game engines like Unity, Unreal, CryEngine and etc. but if you want to create simple games you can even use HTML5 and PHP
Note: Unity language is C# and JS
+ 1
Hey there,
yes a game can be made in php. Like
Game => A basic die roller
1. Using the mt_rand() random number-generator function
function roll () {
return mt_rand(1,6);
}
echo roll();
Then we can pass the type of die we want to roll as a parameter to the function.
2. Passing the type of die as a parameter
function roll ($sides) {
return mt_rand(1,$sides);
}
echo roll(6); // roll a six-sided die
echo roll(10); // roll a ten-sided die
echo roll(20); // roll a twenty-sided die
From here, we can go on to rolling multiple die at once, returning an array of results, or rolling multiple die of different kinds all at once, depending on our needs. But this simple script can be used for most tasks.
THANK YOU.
0
tic tac toe, yes
Call of duty style game...
no.
0
hi everyone
0
yes
- 2
With PHP, they had made an open-source game engine (such as Unity) be downloadable, so I think you can download the Unity or others to make the game which you want.