OZONE Asylum
Forums
DHTML/Javascript
Canvas golf anyone?
This page's ID:
28155
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
Check in the reference of the [url=http://whatwg.org/specs/web-apps/current-work/#drawimage]drawimage() method in the Web Applications 1.0 - Working Draft - 6.1.1.9. Images[/url]. It can take up to 9 arguments to let you draw and resize parts of an image/canvas. [edit] I just check the error console in Opera9, and your script crashes with. [code]JavaScript - http://h1.ripway.com/politickler/canvasgolf/CanvasGolfRange.html Javascript URL thread: "javascript:slice=false;hook=false;straight=true;long=false;shooting=true;swing(0);" Error: name: TypeError message: Statement on line 89: Could not convert undefined or null to object Backtrace: Line 89 of inline#1 script in http://h1.ripway.com/politickler/canvasgolf/CanvasGolfRange.html document["player"].src = golfer[frame].src; if (frame < 17) Line 1 of unknown script slice = false; hook = false; straight = true; long = false; shooting = true; swing(0);[/code] The [i]frame[/i] variable is undefined. How do I know ? I just typed [i]javascript:alert( golfer );[/i] in the address bar. It was fine, then I typed [i]javascript:alert( golfer );[/i] and it was undefined. Beside that I have to say: Duh! Regarding the visual aspect of the play field I expect to see the camera follow the ball and thus it would have been easier to draw the player using Canvas. Thus my advice to have a look at the reference. If you keep the player in a regular IMG tag, you can place it with a [i]position:absolute;[/i] and set the [i]top[/i] and [i]left[/i] properties using the same formulas you use to draw the ball in '3d'. How do you see the game ? will the camera stand still and the player will be moved and scaled to the position of the ball or will the camera jump at the position of the ball once it's stopped ? [/edit] [url=http://www.p01.org/][img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_galaxy.gif[/img][/url] [small](Edited by [url=http://www.ozoneasylum.com/user/2185]poi[/url] on 07-04-2006 09:41)[/small]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »