The Daily Click ::. Forums ::. Digital Works ::. It's Javascript, dear; Javascript.
 

Post Reply  Post Oekaki 
 

Posted By Message

DeadmanDines

Best Article Writer

Registered
  27/04/2006
Points
  4758
25th June, 2009 at 13:00:33 -

Making games in Javascript's actually quite fun!

Yay for the DOM!

www.denyeradmin.co.uk/javascript/

GOT:

Movement engine
Some sound (for IE only)

DON'T GOT:

Collisions
Enemy motion
Rotation
Scrolling
Anything else

KEYS:

Arrow keys = move
Shift = become more streamlined (acceleration better, everything else worse)


Hey, it turned out better than expected, right?

Next stuff to do is prepare an AJAX preloader, game ui, work on collisions and try and create an actual engine for it.

 
191 / 9999 * 7 + 191 * 7

[DELETED]

Likes to put dots on paper

Registered
  08/12/2008
Points
  118

MushroomVIP MemberARGH Sign
25th June, 2009 at 17:14:11 -

Thats impressive for Javascript

 
n/a

MrPineapple

the fruitiest word i know

Registered
  14/10/2008
Points
  1449

VIP Member
25th June, 2009 at 19:51:25 -

i'm more impressed by the fact that its deadmanDines!

all the planets must be in alignment or something...

Edited by MrPineapple

 
i am STILL a talking pineapple!

OMC

What a goofball

Registered
  21/05/2007
Points
  3516

KlikCast Musician! Guy with a HatSomewhat CrazyARGH SignLikes TDCHas Donated, Thank You!Retired Admin
25th June, 2009 at 20:02:22 -

Purdy.
 
 

			
  	    

 

  		
  		

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
28th June, 2009 at 02:43:41 -

"Thats impressive for Javascript "

not quite. javascript can do so much more impressive stuff.

 
n/a

[DELETED]

Likes to put dots on paper

Registered
  08/12/2008
Points
  118

MushroomVIP MemberARGH Sign
28th June, 2009 at 04:13:56 -

Really? I had no idea. I only ever dabbled with copy/pasting JavaScript codes when I made websites as a youngster. Annoying things like fake password entries and things, no right click, crappy stuff like that.

 
n/a

X_Sheep

I had a custom rating before it was cool

Registered
  01/03/2004
Points
  1313

VIP MemberPicture Me This -Round 23- Winner!Dos Rules!
28th June, 2009 at 13:31:29 -


Originally Posted by jthongbai
Annoying things like fake password entries and things, no right click, crappy stuff like that.



Giant ascii clocks that follow your mouse

 
a/n

DeadmanDines

Best Article Writer

Registered
  27/04/2006
Points
  4758
28th June, 2009 at 22:27:45 -

Yeah, Cecil's right, this is uber basic.

I think it's just a surprise, because most web users (as opposed to developers) don't really see Javascript used in this context. It's a far cry from the menus and auto-suggest forms that we're used to seeing done with it.

But it's a really nice development option in my opinion. You can just piggy-back off SO many good technologies - CSS, HTML, Serverside Scripts, AJAX, ActiveX, all sorts.

 
191 / 9999 * 7 + 191 * 7

MBK



Registered
  07/06/2007
Points
  1578

VIP Member
6th July, 2009 at 01:41:00 -

Very nice. Your flame animation should change when the rocket wing things come in to the side though.
You'll want to change the fire when that happens so that it is longer and thinner for the speed boost.

Sounds quite fascinating ... so is Javascript easier than Flash?


 
Click Me! http://www.create-games.com/project.asp?view=main&id=1444

http://www.mediafire.com/download.php?aoo1dnnlq5i

Blood of the Ancient One, Seen only as Shadow, Faster than Lightning, Fierce as the Greatest Dragon, Nearly Invisible, Floating in a Dream, Entered through the Demon Door, Destroyer of Evil in a Realm with a Red Sky Scarred, Who could I be ?

DeadmanDines

Best Article Writer

Registered
  27/04/2006
Points
  4758
10th July, 2009 at 11:40:00 -

I don't know, I've never used flash's action script.

But it's handy for the way it links with all these other technologies. The DOM is also very handy - I'm experimenting by putting objects in a kind of DIV wrapper. E.g.


<div id="enemyHolder">
<div id="bugHolder">
<div class="bug"></div>
<div class="bug"></div>
<div class="bug"></div>
</div>
<div id="zimHolder">
<div class="zim"></div>
<div class="zim"></div>
<div class="zim"></div>
</div>
</div>


It lets you use the appendChild() and removeChild() functions to add and remove objects, but also lets you use the childNodes[] property to loop through specific object groups.

So you can walk the dom for all enemy types (elements under 'enemyHolder') or specific enemy types only ('bugHolder' elements for instance).

It's spiffy.

My next task is to see if I can move a collection of elements from one group to another.

One downer I have noticed though is that handling many objects will lag heavy in even the mighty Chrome (can you find a faster browser? Me thinks not). So beware of having more than about 30 objects moving onscreen at a time.

 
191 / 9999 * 7 + 191 * 7

Muz



Registered
  14/02/2002
Points
  6499

VIP MemberI'm on a BoatI am an April FoolHonored Admin Alumnus
11th July, 2009 at 07:32:35 -

Why is it when I press both left and right buttons, it goes left? I'd expect it to go right, with the flames and all

 
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.

Image

Deathbringer



Registered
  05/07/2002
Points
  1585
14th July, 2009 at 11:09:05 -

There's a really awesome looking 3D game engine called Unity3D that can be scripted with Javascript, i hate code and had a terrible time with Darkbasic (then again i hear in many quarters that it's rubbish) but i'm still going to try Unity out .

Also Clickteam's own Jamagic was scripted with a version of Java. Whatever happened to that anyway? . I only ever saw one game made with it, and that was an Asteroids clone that could have been done in MMF with a little trouble (it had 360 degree rotation and an asteroids-ey movement engine, both of which could be done in MMF2 with ridiculous ease )

 
A signature

DeadmanDines

Best Article Writer

Registered
  27/04/2006
Points
  4758
14th July, 2009 at 19:30:58 -

From what I can see, Unity3D is only a plugin that you can control through JS, not a fully JS engine...

EDIT: "That can be scripted with Javascript" - oops, didn't spot that bit; my bad

Edited by DeadmanDines

 
191 / 9999 * 7 + 191 * 7

Deathbringer



Registered
  05/07/2002
Points
  1585
14th July, 2009 at 19:45:23 -

Hmm, i type too much...

Unity can also use C and something else to script it, but Java seems to be the "main" one used, probably because it's also used for the internet a lot so people probably know it.

Also a long time ago somebody told me that Command & Conquer was made with Java, but i don't know if that's true or not.

 
A signature
   

Post Reply



 



Advertisement

Worth A Click