Dark Bit Factory & Gravity

GENERAL => Challenges & Competitions => Topic started by: combatking0 on October 22, 2007

Title: [Halloween]: Endless Graveyard
Post by: combatking0 on October 22, 2007
This is my Endless Graveyard demo. It is in 25% of the resolution I wanted, and still it runs slowly. Maybe someone with a fast machine will see it run very quickly.

It is a paralax scroller, made in HTML and JavaScript. No music - enjoy!

[edit] I just tried it on my works machine and it runs too fast, so I have slowed it down. I'll redo the full-size version and see if that runs at a decent speed[/edit]

[edit] I have now added the full size version, for those with machines powerful enough to view it. [/edit]
Title: Re: [Halloween]: Endless Graveyard
Post by: benny! on October 22, 2007
Runs fine here. Nice work ck0! First Halloween entry !!! yeah ...
Title: Re: [Halloween]: Endless Graveyard
Post by: Jim on October 22, 2007
Dude, given my desperate(ly bad) effort for the javascript comp, this deserves some Karma.  Making anything happen in JScript is too much work, so this is excellent.  Good stuff!
Jim
Title: Re: [Halloween]: Endless Graveyard
Post by: Shockwave on October 22, 2007
Really nice to have something that rus in a browser and it works on Firefox too :)
Title: Re: [Halloween]: Endless Graveyard
Post by: Rbz on October 22, 2007
Works fine here, I'm using Firefox.

I only miss some spooky sound effects  ;)
Title: Re: [Halloween]: Endless Graveyard
Post by: rain_storm on October 22, 2007
Nice one CK0, Well I dont know anything bout Java but if Jim is saying that its difficult to get something up and runnin then I respect the time and effort that you have put into this entry
Title: Re: [Halloween]: Endless Graveyard
Post by: combatking0 on October 23, 2007
Thanks everyone!

Hopefully the edit above should be the final version.

Most of the time went into the artwork, but there was a lot of tweeking to be done with the timing.
Title: Re: [Halloween]: Endless Graveyard
Post by: taj on October 23, 2007
well done ck0, I agree with Jim, getting stuff up and running in JS - not easy at all. The scrolling effect is neat.
Title: Re: [Halloween]: Endless Graveyard
Post by: ninogenio on October 23, 2007
i really think this is great, good one ck0!
Title: Re: [Halloween]: Endless Graveyard
Post by: p01 on October 25, 2007
rain_storm: This is JavaScript, not Java. These are completely different beasts.

combatking0: (http://dbfinteractive.com/Themes/azure_11final_tp/images/huh.gif) You're using foo.innerHTML = text.substr( start, end );. Seriously ? Please, pretty please check the {JS} Scrollers (http://dbfinteractive.com/index.php?topic=2462.0) thread.

Quote
[edit] I just tried it on my works machine and it runs too fast, so I have slowed it down. I'll redo the full-size version and see if that runs at a decent speed[/edit]

[edit] I have now added the full size version, for those with machines powerful enough to view it. [/edit]

Animations MUST check the current time to make sure they run at the same speed on anywhere.

In your case it could be as simple as:
Code: [Select]
$ = document.getElementById
function main()
{
var pps = 50
,pos = new Date().getTime()/1000*pps;

$('bgnd1').style.left = -( Math.round( pos   )%320 )     +'px';
$('bgnd2').style.left = -( Math.round( pos*2 )%320 )     +'px';
$('fgnd' ).style.left = -( Math.round( pos*3 )%320 )     +'px';
$('wtch' ).style.left = (( Math.round( pos*2 )%320 )-18) +'px';

$('txt'  ).style.left = -( Math.round( pos )%$('txt').offsetWidth ) +'px';
}

Hope that helps,
Title: Re: [Halloween]: Endless Graveyard
Post by: combatking0 on October 25, 2007
Cheers p01, I'll refer to this in future when developing a text scroller.
Title: Re: [Halloween]: Endless Graveyard
Post by: rain_storm on October 25, 2007
Oops my bad, I thought Java and Javascript were just two ways of refering to the same language but now I know better  :whack:
Title: Re: [Halloween]: Endless Graveyard
Post by: combatking0 on October 26, 2007
The people hosting my JavaScript Game Programming Course make that same mistake every year!
Title: Re: [Halloween]: Endless Graveyard
Post by: Shockwave on October 26, 2007
Some good Karma for p01 for the Javascript tip :)
Title: Re: [Halloween]: Endless Graveyard
Post by: Tetra on October 28, 2007
As limited as JS is you always seem to manage to make something pretty cool with it :)
Title: Re: [Halloween]: Endless Graveyard
Post by: p01 on October 28, 2007
JavaScript is not that limited. There's a couple of JavaScript demos and intros with classic effects ( vector balls, scroller, twister, fire, water, bump, metaball, voxel landscape, fractal, starfield, ... ) and 3D effects ( raycasting, flat, gouraud, I even did some (low-res perspective correct mapping in gouraud )
Title: Re: [Halloween]: Endless Graveyard
Post by: combatking0 on October 29, 2007
Wow, I never knew JS had that much graphic capability.

Is all of this in the W3C specification, or a special browser?
Title: Re: [Halloween]: Endless Graveyard
Post by: p01 on October 29, 2007
all done in standard compliant browsers using standards as old as 10yo