Computer Science Canada Bouncing a ball off a semi-circle ?? |
Author: | CITC [ Tue Jan 06, 2004 8:41 pm ] |
Post subject: | Bouncing a ball off a semi-circle ?? |
Hi everyone, first before I ask my question I'd like to say what an AMAZING site this is... truly INCREDIBLE!!!!!!!!! k, with that being said, I'd like to make a turing version of a game I found on www.addictinggames.com called Slime Volleyball. If you haven't played it you can check it out here http://tartarus.uwa.edu.au/%7Ewedgey/slime1/ the biggest problem I have with making this game is that in the game the players are semi-circles (slimes) and the ball bounces off of these semi circles, reflecting appropriately. I've thought and thought about this, but can't figure out how to do it. Anyone know how? Thanks in advance!! CITC |
Author: | Maverick [ Tue Jan 06, 2004 8:47 pm ] |
Post subject: | |
Slime volleyball kinda sux, you shuld make slime soccer. I think I know where to get the code for that bouncing thing. I'll post in a day or two. |
Author: | AsianSensation [ Tue Jan 06, 2004 9:10 pm ] |
Post subject: | |
you kinda have to know a bit of physics or at least some math to be able to do this. Tell me what you know about projectiles or parabolas so I can help you out. |
Author: | shorthair [ Wed Jan 07, 2004 11:51 am ] |
Post subject: | |
the cheesy way out if you dont know alot about math and physics, is to make arbitraraly mabye 10 different angles so if the ballx = slimex or ballx = slimex + 10 then ........ make your angles , but asian is right there is a proprer way to do it |
Author: | CITC [ Wed Jan 07, 2004 5:00 pm ] |
Post subject: | |
hehe Slime soccer was good too. fortunately if i make slime volleyball i can fairly easily change it to slime soccer as for the math bit, I'm really good at math and physics, but I'm only in Grade 10 (I've taken Gr 10 science but Gr 10 math is next semester). don't know anything about projectiles or parabalas but tell me and I'll see if i can pick it up. if i can't, I can go with shorthair's suggestion oh yeah also I found the code for that game too but it was in Java and totally confused me |
Author: | Homer_simpson [ Wed Jan 07, 2004 8:40 pm ] |
Post subject: | |
that's not a bad game... i kinda like the idea...it's creative and everything, it's actually a good idea to hand in something like that for yer fp... Any way if u wanna learn to do that... check out my tutorial on projectile physics... basically all u need is the velocity and the angle the ball hit's the player at... |
Author: | Homer_simpson [ Wed Jan 07, 2004 10:01 pm ] | ||
Post subject: | |||
in fact i liked the simplicity of the idea so much... i'll give u something to start with...
|
Author: | CITC [ Thu Jan 08, 2004 7:53 pm ] |
Post subject: | |
wow thanks for that code! I haven't read through much of it yet but from running it in turing it looks like there isn't much else to do. did you just make this now or was this a slightly altered part of your tutorial that you mentioned? Also, where can I look at this tutorial? |
Author: | Homer_simpson [ Fri Jan 09, 2004 12:16 am ] |
Post subject: | |
well i didn't rewrite parts of the code i already had... |
Author: | CITC [ Sat Jan 10, 2004 11:36 am ] |
Post subject: | |
I've been working on the game and I've added the second player and made the ball bounce off him the same as it does off player 1. the thing I don't get is why does the ball bounce oddly off of the walls and net? It bounces as though it had either a topspin or a backspin (its not just reflected, it will sometimes shoot quickly down or other times shoot pretty horizontally across the screen). I've been playing around with it but can't find any way to fix it. |
Author: | CITC [ Sat Jan 10, 2004 12:40 pm ] |
Post subject: | |
oh and theres one other kinda quirky thing.. sometimes the ball goes inside the slimes and bounces around for a half second or so building up velocity, then shoots out in some wierd direction. I think I might be able to fix these things if I could understand the ResetP procedure. What are sx,sy,v,a, and w. I understand what they stand for, but when were they created and what are their values? |