OZONE Asylum
Forums
DHTML/Javascript
20 Liners - January 08 - Dynamics
This page's ID:
29836
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
Arthurio: Thanks for the suggestion about the ternary conditional operator instead of ifs. Is there a way I could capture mouse position without wasting too many lines? poi: I've ditched the switch-case and replaced it with a for-in, for your temptation to count the case labels :) I don't know how switching to a normal array would reduce the # of lines; it would eliminate the "className" references but the # of lines would be the same. Am I perhaps missing something? Re-ordering the sprites would also just help optimize the CSS and I wouldn't gain any JS lines from that. Implementing BD clones is a hobby of mine as well :) I have so far had one 68000 implementation on Amiga, one on Delphi and another (more complete) one in JS. Seems like the first thing I do when I get my hands on a new language is to implement a BD clone, instead of a "Hello World!" :) The [url=http://magnetiq.com/bd20/]code[/url] is now down to [b]15[/b] lines and now I'm tempted to add more elements :) Features: * Boulders and diamonds obey gravity * Boulders and diamonds slide over walls and other boulders or diamonds * Boulders prefer to slide left when balancing on another boulder or diamond * Diamonds prefer to slide right when balancing on another boulder or diamond * Butterflies are left-hand followers * Rockford has a mind of his own <crappy-signature>[url=http://magnetiq.com/]magnetiq.com[/url]</crappy-signature> [small](Edited by [url=http://www.ozoneasylum.com/user/6682]MaGnA[/url] on 01-29-2008 18:34)[/small]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »