Topic: Canvas golf anyone? |
|
---|---|
Author | Thread |
Obsessive-Compulsive (I) Inmate From: Connecticut |
posted 07-04-2006 04:31
I'm trying to make a golf game but it only seems to work in firefox. I think it has to do with scaling the image, but i'm not sure. Can anyone think of a way to scale the image and move it around without using the scale in canvas? Or at least suggest a way it can be done? I tried a few things, but I'm too embarrased to post them so they got deleted. They didn't work anyway. I was trying to use moveTo() but it was wrong. anyway, I'll work on it, but I was hoping a kind programmer could suggest a way for the noob to follow. here's a link to canvas golf range. It's very basic. The guy hits the ball and the ball flies. It's the first step in my game but it won't work in IE or opera as far as I know. At least not on my machine (pentiumIII windose 2000pro). |
Paranoid (IV) Inmate From: Norway |
posted 07-04-2006 09:25
Check in the reference of the drawimage() method in the Web Applications 1.0 - Working Draft - 6.1.1.9. Images. It can take up to 9 arguments to let you draw and resize parts of an image/canvas. 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);
|
Obsessive-Compulsive (I) Inmate From: Connecticut |
posted 07-04-2006 17:42
I'm planning on having the player and screen jump to the next position after the shot is complete. In my opinion, the visuals are an accurate representation of actual golf. It's meant to simulate the real golf experience. When you actually play golf, this is what you'll see. Besides, I'm not knowledgable enough yet to create such cool effects as following the ball flight. Maybe I'll add it between the shot ending and moving to the new ball position once i learn how to do it. First you see the guy shoot and then switch to the ball landing on the fairway or wherever. All in good time. I'm still learning... even some of the basics. I have no actual computer training. Never even took a computer course. Sad, but I missed the computer revolution. I'm trying to catch up. thanks for looking at the script. Here's a version I got working in opera and IE. Still a problem with golfer[]. Something about not being able to convert from null. But it works. IE was really fast when it worked, but then crashes about halfway through the shot. |
Bipolar (III) Inmate From: Sweden |
posted 07-06-2006 11:49
Lol, it does not only crash the script, it completely crashed the browser, and fast indeed! |
Obsessive-Compulsive (I) Inmate From: Connecticut |
posted 07-06-2006 14:20
TwoD |