Dark Bit Factory & Gravity
GENERAL => Challenges & Competitions => Topic started 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]
-
Runs fine here. Nice work ck0! First Halloween entry !!! yeah ...
-
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
-
Really nice to have something that rus in a browser and it works on Firefox too :)
-
Works fine here, I'm using Firefox.
I only miss some spooky sound effects ;)
-
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
-
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.
-
well done ck0, I agree with Jim, getting stuff up and running in JS - not easy at all. The scrolling effect is neat.
-
i really think this is great, good one ck0!
-
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.
[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:
$ = 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,
-
Cheers p01, I'll refer to this in future when developing a text scroller.
-
Oops my bad, I thought Java and Javascript were just two ways of refering to the same language but now I know better :whack:
-
The people hosting my JavaScript Game Programming Course make that same mistake every year!
-
Some good Karma for p01 for the Javascript tip :)
-
As limited as JS is you always seem to manage to make something pretty cool with it :)
-
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 )
-
Wow, I never knew JS had that much graphic capability.
Is all of this in the W3C specification, or a special browser?
-
all done in standard compliant browsers using standards as old as 10yo