How to make a web browser Game

Is it possible to make a web browser game? (and get it online)

Page 1 of 1

2 Replies - 30115 Views - Last Post: 16 January 2008 - 03:09 PM Rate Topic: -----

#1 martijn 007   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 16-January 08

How to make a web browser Game

Post icon  Posted 16 January 2008 - 07:43 AM

[font=Arial][size=1]Is it possible to make a free web browser game, and get it online?

i'm pretty good at making games with game maker, but i'm always thinking how to make a free web browser game.
if somebody could help me, please. (if i need to use any other program then Game Maker, it's also okay)

Martijn.007 :)

Is This A Good Question/Topic? 0
  • +

Replies To: How to make a web browser Game

#2 csmanoj   User is offline

  • D.I.C Head
  • member icon

Reputation: 11
  • View blog
  • Posts: 150
  • Joined: 06-August 07

Re: How to make a web browser Game

Posted 16 January 2008 - 08:45 AM

Learn Flash to make simple games. Then learn XHTML to host them on the web. After that learn Actionscript to take your games to a cool new level. After that learn some server side scripting language ASP or PHP.
Was This Post Helpful? 0
  • +
  • -

#11 TheMagnitude   User is offline

  • D.I.C Head
  • member icon

Reputation: 4
  • View blog
  • Posts: 144
  • Joined: 12-January 08

Re: How to make a web browser Game

Posted 16 January 2008 - 03:09 PM

No other external tools or programs are required except Game Maker and a dll.

Firstly to connect to the internet and use the HTTP protocol in Game Maker. You can either use the readily made mplay_ functions avaliable, but there a bit slow. I recommend using 39dll (GMC topic) to handle all your winsock calls.

So basically download the dll and scripts for 39dll.

Once you have them heres the code to execute a HTTP protocol:
// HTTP(host, GET/POST,POST variables)
if !bufferexists(global.HTTP_buffer)
//if !tcpconnected(global.HTTP_sock)
 global.HTTP_sock = tcpconnect(argument0, 80, 0);
  show_message("Unable to connect to "+argument0);
  return -1;
setformat(global.HTTP_sock, 1, chr(13) + chr(10));
newLine = chr(13) + chr(10);
writechars(argument1+" HTTP/1.0" + newLine,global.HTTP_buffer);
writechars("Host: "+argument0 + newLine,global.HTTP_buffer);
writechars("User-Agent: Shadow Zone/1.0" + newLine,global.HTTP_buffer);
if is_string(argument2)
	writechars("Content-Type: application/x-www-form-urlencoded"+newLine,global.HTTP_buffer);
	writechars("Content-Length: "+string(string_length(argument2))+newLine,global.HTTP_buffer);
//show_message(argument1+" HTTP/1.0" + newLine+"Host: "+argument0 + newLine+newLine+argument2);
processHeader = true;
	firstWord = readsep(newLine,global.HTTP_buffer);
		case "":		//blank line
			processHeader = false;
		//read important stuff from header...
setformat(global.HTTP_sock, 2);
retVal = "";
	size = receivemessage(global.HTTP_sock, 6000,global.HTTP_buffer);
	if(size > 0)
		retVal += readchars(size,global.HTTP_buffer);
	else break;
return retVal;

This is how you would use the above code once 39dll and the scripts are implemented into your game.

To open
HTTP("","GET /index.php");

This function will return the HTML code of the webpage. I'm not sure how you would parse the HTML code to display it as a webpage but that is how you access a webpage.


PS: If you meant to play your games in a web browser refer to csmanoj's post, but if you wanted to turn your game into a web browser :P use this post and reply if more help is required.
Was This Post Helpful? 1

Page 1 of 1