Jump to content

Making Sohiscated Games


nideba

Recommended Posts

What about those games like WarCraft or Red Alert?
They are made with C++ and OpenGL or DirectX...JavaScript runs in a browser...a browser could never hold up under the huge demands a game like that would need.You can use Flash to make games and JavaScript can make some simple games but huge games require C# or C++ and be run as a desktop application.
Link to comment
Share on other sites

JavaScript can make 3D games. It is possible with the <canvas> tag. Let me get a link for you....http://www.abrahamjoffe.com.au/ben/canvascape/textures.htmThat's a 3d game (well, maze) that has textures and a guy and a tracking system, all made in javascript :)

Link to comment
Share on other sites

JavaScript can make 3D games. It is possible with the <canvas> tag. Let me get a link for you....http://www.abrahamjoffe.com.au/ben/canvascape/textures.htmThat's a 3d game (well, maze) that has textures and a guy and a tracking system, all made in javascript :)
Very cool although it was a bit slow for me...probably just my PC tho...have a very bad video card at work.Hey choco what is the canvas tag? I never heard of it.
Link to comment
Share on other sites

I can't really explain it. All I know is it has capabilities of plotting things, including creating 3d characters, grids, and 3 dimensional graph plotting. :) I also know that a person on another forum I'm part of created something with it so that, with the right equation, you could take a 3d rendered image from a 3d studio program, and put it on the web and view it in all its glory (rotate, spin...) It was quite cool. :)Also, this is what the Safari JavaScript programming topic documentation says.

A canvas is an HTML tag that defines a custom drawing region within your web content. You can then access the canvas as a JavaScript object and draw upon it using features similar to Mac OS X’s Quartz drawing system. The World Clock Dashboard widget (available on all Apple machines running Mac OS X version 10.4 or later) shows a good example , though using a canvas is by no means exclusive to Dashboard.There are two steps to using a canvas in your web page: defining a content area, and drawing to the canvas object in the script section of your HTML.
Link to comment
Share on other sites

It does that if you're on the "high detail" version. In that select box under the game, just choose "low" and it'll work fine. :) Also, there's a non-textured version that works perfectly:http://www.abrahamjoffe.com.au/ben/canvascape/Edit--darn, you're right. It is going slowly in even low. But the untextured version works fine, just use that :)

Link to comment
Share on other sites

Nice...It looks like an M16 from Delta Force to me, plus Wolfenstein3D as mentioned :) Though I did not find the Boss...Still slow of course, especially for a game, but probably would be sufficient for something like giving a tour in an apartment/house for sale or rental, or anything similar that would not require the resources that a real 3D game demands.

Link to comment
Share on other sites

In case anyone is interested I played with the tutorials from Mozilla and came up with the code below. You just need to change the img.src to your own image and it produces a game board that allows you to use WASD to move the image around the dimensions of the board.I really like canvas it makes this so much simpler...too bad IE doesn't support this.

<html><head>	<title>Canvas Test</title>	<script type="text/javascript">			//preload image		var img = new Image();		img.src="under-construction.gif";		var ctx;		var unit = 10;		var x = 0;		var y = 0;		var minx = 0;		var miny = 0;		var maxx;		var maxy;				function setup()		{			canvas = document.getElementById('canvas');			canvas.style.border = '1px solid #b8b8b8';			maxx = canvas.width - img.width;			maxy = canvas.height - img.height;			ctx = canvas.getContext('2d');			//overloads			//+1 drawImage(imageObject,x,y)			//+2 drawImage(imageObject,x,y,width,height)			//+3 drawImage(imageObject,sx,sy,sWidth,sHeight,dx,dy,dWidth,dHeight)			ctx.drawImage(img,x,y);		}				function keyPress(e)		{			switch(e.which)			{				case 97: 	//w - forward					move("up");					break;				case 119:  	//a - left					move("left");					break;				case 100: 	//s - down					move("down");					break;				case 115: 	//d - right					move("right");					break;				default:	//anything else					break;			}		}				function move(dir)		{			switch(dir)			{				case "up":					x = x - unit;					if(x < minx) x = minx;					break;				case "left":					y = y - unit;					if(y < miny) y = miny;					break;				case "down":					x = x + unit;					if(x > maxx) x = maxx;					break;				case "right":					y = y + unit;					if(y > maxy) y = maxy;					break;							default:					alert('other');					break;			}				ctx.clearRect(0,0,canvas.width,canvas.height);			ctx.drawImage(img,x,y);		}						window.onload = setup;		window.addEventListener("keypress", keyPress, false)		</script></head><body>	<canvas id="canvas" width="625" height="425"/></body></html>

Link to comment
Share on other sites

Well, that's great. Thank you. What about very sohiscated 3D games? I would like those Role-playing Games like Counterstrike and Warcraft.
You cannot make those types of games in JS...well I guess you could but they would run so slow they would be unusable. Look at the 3D walk around sample...even that is s bit choppy and slow. Like I said before the browsers that we have now cannot handle the demands of intense games like warcraft. Maybe in the future if APIs are intorduced that let JS access the PC video card then maybe things will change but not for a while.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...