Turing Pool Game
Author |
Message |
bubb4h0t3p
|
Posted: Thu Jan 22, 2015 5:41 pm Post subject: Turing Pool Game |
|
|
This was my final project for grade 10 programming, I ran out of time so many of the features I wanted to include but I didn't have enough time to implement/fix them
Things that didn't make it in:
- Working ball hit and sink sounds, Turing just didn't want these ones to work in conjuction with the music, even though they're .WAV and the music is .MP3, the sounds are still included if you can fix them
- Player turns and score tracking/ waiting for the balls to stop and then switching turns to the other user
- Drawing stripes on striped balls, somewhat difficult to do since with Draw.FillBox you can't compensate for the ball being round
- I forgot to list the instructions/rules in the actual game
- Actually drawing a pool cue, this felt pretty difficult though as I would have to rotate the picture around the axis of the white ball (Pic.Rotate?)
- The balls will continue to move a small amount because the reduction from friction is based on dividing the current velocity, when the balls velocity is extremely low it barely reduces it causing them to move for a bit
- Reset the game after the white ball is sunk
Instructions/controls:
- when in the settings menu double click on the song you want to select
- click, drag then release to shoot the white ball, remember to click on the white ball then drag to have an accurate shot
- pressing the escape or 'q' key while in the main game will open the menu
Try changing the constants at the top (DELAY, BALLRADIUS and FRICTION), you can get some interesting results...
Massive thanks to Zylum for his perfect circle collision tutorial
I'm including source code but please don't just rip the code and pretend it's your program, if any teacher finds this submitted to them I've already handed this in so unless I've been referenced you're plagiarising
I put a lot of time, (coffee ) and effort into this so any feedback would be highly appreciated!
Description: |
|
Download |
Filename: |
8 Ball Pool Final.zip |
Filesize: |
20.33 MB |
Downloaded: |
669 Time(s) |
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
Insectoid
|
Posted: Thu Jan 22, 2015 7:21 pm Post subject: RE:Turing Pool Game |
|
|
I'm not sure if you plan on updating this, but if you want to finish some of the features you missed,
1. Dunno how to fix the sounds. Try using all MP3s if you must. It's always been hit or miss for me.
2. Turns & score tracking should be trivial to add, if you've gotten this far.
3. Dunno how to do this simply. It could be a whole project on its own. Clever animation tricks might do it, but I'd have to take a serious look at the problem to figure it out.
4. Doesn't matter. It's simple.
5. You can easily do this with clever usage of Draw.Arc. If you want to use an image, then Pic.Rotate with simple translation will do. There are plenty of tutorials on this as it uses pretty basic math, but if you're patient, you'll learn it in grade 11 advanced functions anyway.
6. You can impose a hard limit. If velocity < 0.0005 then velocity := 0.
7. Again, trivial. Requires almost no work.
I don't have time to run the code and do an in-depth review but I'll look at it tomorrow. If you've managed to do accurate physics, including interframe collisions and bouncing, that's very impressive and I have no doubt you can finish the features you left out. Pool is a difficult game to simulate compared to other common games so props to you.
|
|
|
|
|
|
bubb4h0t3p
|
Posted: Thu Jan 22, 2015 8:23 pm Post subject: Re: RE:Turing Pool Game |
|
|
I could definitely fix some of these things pretty easily, I'll work on it over the next few days, thing is that the day I had to hand it in was today. So even the small stuff I kind of had to omit, I'll update it with some of the simple stuff and maybe add the pool cue as well, but honestly I spent way too much time on those two sounds for the balls hitting each other, both getting them and trying to fix them. Maybe I should even post a "help" section on how to fix this, I suspect that it's either because the music I'm playing is in the "menus" module and the other sounds are not, or the music that's played isn't in it's own process, the songs are played in just one procedure that just changes "songChoiceName"...
TL;DR I will update adding some of the stuff, won't add stripes, sound problem is more difficult than expected
|
|
|
|
|
|
Insectoid
|
Posted: Thu Jan 22, 2015 8:27 pm Post subject: RE:Turing Pool Game |
|
|
Music.PlayFileLoop should be able to play multiple sound files at once, because it spawns a new process for each sound.
|
|
|
|
|
|
bubb4h0t3p
|
Posted: Thu Jan 22, 2015 8:40 pm Post subject: RE:Turing Pool Game |
|
|
It's not like the program crashed or even gave an error, the sounds outside of the music simply didn't even make a sound, the names for the sound processes are "singleHit" and "ballSunkSound", they're still in the code.
|
|
|
|
|
|
bubb4h0t3p
|
Posted: Thu Jan 22, 2015 8:45 pm Post subject: RE:Turing Pool Game |
|
|
I'll try separating each of the songs into it's own process because I'm almost sure that's the problem
|
|
|
|
|
|
|
|