----------------------------------- Cervantes Sat Mar 27, 2004 10:32 am Cervantes' "Evasive Maneuvers" :P updated ----------------------------------- UPDATED VERSION: new things balls can no longer spawn next to you / inside you collisions between circles are REAL! balls don't get stuck in the wall I like your title Mazer :) I posted this little game in the Turing Help section in Paul's thread about making several objects bounce around the screen. Basically, you are the red circle. You use the arrow keys to move around. Blue circles will spawn and move around at random speeds and directions. Try to evade these circles as long as you can. NOTE: you can't move to the edges of the screen. This is done intentionally so that you can't hide in a corner: it takes forever to die when you do this :think: Hope you like it ----------------------------------- recneps Sat Mar 27, 2004 10:58 am ----------------------------------- pretty cool, but i dont think you needed all of that arctand and sin cos stuff lol just when randomize the ball "movex" and "movey" so its at different angles, then reverse it when it hits a wall. Anyway +BITS Edit: i WAS gonna give you bits but you're a mod :) ----------------------------------- Cervantes Sat Mar 27, 2004 11:53 am ----------------------------------- yes I could take out a lot of that collision stuff. Like instead of having mass + mass i could just put in 2. But I wanted to leave it like thoughtful had it in his pool tutorial so that anyone that looks at this but not thoughtfuls pool it can still learn collision data between circles. ----------------------------------- Tony Sat Mar 27, 2004 1:43 pm ----------------------------------- nice, I like the game :D cool consept. It was preaty crazy when I got up to 12 balls after me :lol: anyways, the only sujestions I got are the spawing of balls... Seeing as it is compleatly random, there's a chance that two balls might spaw inside each other (that tends to cause problems) and even more of a consern, balls spawing right next to player :? also powerups would be nice. I found that with the number of balls increasing, that player's ball was not as fast as I hoped 8) ----------------------------------- the_short1 Sat Mar 27, 2004 2:14 pm ----------------------------------- nice stuff cervants + bits if u nto a mod... i like ....i like a lot..!!!! it took 17 balls.... i have slow comp and lots of stuff runing. (winamp radio) MSN, firewal, bunch of turing crap... compsci.,.. one issue... one ball got stuck in a star's poity thing... then it got hit.. and just rolled along the bottom... (up and down over the stars points...) see the picture.. NICE GAMe!!!!!! ----------------------------------- Cervantes Sat Mar 27, 2004 2:28 pm ----------------------------------- ya that happens sometimes. I should really iron out the bugs in this thing :think: jeeze, you guys get to 12 balls, 17 balls, I get to 7 :oops: tony -> yea it does suck when a ball spawns on top of you :lol: I might get around to fixing that, or someone could fix it for me :P Does anyone think that the collision data is a bit off? It seems to me that it is nothing like thoughtful's pool collision data, even though its the same code! in his pool, the balls bounced more realistically. In this, the balls sometimes bounce in the wrong direction. Allow me to illustrate with snipits of code from the game. ----------------------------------- the_short1 Sat Mar 27, 2004 9:40 pm ----------------------------------- yea thats pretty messed..... hey Cervants... ur on a roll... keep it up... like i mean... within the last 3 days... uve submited like 10 realy REALY cool programs... ----------------------------------- Tony Sat Mar 27, 2004 11:44 pm ----------------------------------- eh? the collision seems to be messed up, I'm not following the code :? I'm guessing that optimized part is an attempt at something related to inertial forces :? and I don't see a space where dx/dy actually get changed :? ----------------------------------- jonos Sat Mar 27, 2004 11:53 pm ----------------------------------- hey i got to 5 balls :/ nice game, it just reminded me that im going to make the degenatron from vice city... haha ----------------------------------- the_short1 Sun Mar 28, 2004 12:37 am ----------------------------------- WOW!!! new record... 22 balls....!!!!!!! it was quite laggy with taht much movement.,.. + i was playing an mp3...... crzy STUF!!! i love dat game... ----------------------------------- Tony Sun Mar 28, 2004 1:02 am ----------------------------------- wow, this game is addictive :o 17, though I modded the game so that balls don't spawn within 100 pixels of me :lol: ----------------------------------- Cervantes Sun Mar 28, 2004 10:20 am ----------------------------------- tony. not only are you a complete genius, but I am a total idiot :oops: :cry: the collision works perfectly now. Now that it does, I feel good about working on this prog again, so I'll try to fix a few bugs. ----------------------------------- Tony Sun Mar 28, 2004 3:32 pm ----------------------------------- :lol: Cervantes - you're right about that idiot part :roll: you balls will not spawn within 100 pixels of initial starting position :wink: To make it really work, you have to randomly pick the position when the number of total balls is being increased. var counter : int := 0 %to compare is the new ball just spawned loop timer := Time.Elapsed totalballs := round (timer / 5000) exit when totalballs > 20 or hit = true if totalballs > counter then %new ball just spawened counter += 1 %update counter loop x (counter) := Rand.Int (20 + ballradius, maxx - 20 - ballradius) y (counter) := Rand.Int (20 + ballradius, maxy - 20 - ballradius) exit when Math.Distance (px, py, x (counter), y (counter)) > spawndistance end loop dx (counter) := Rand.Int (-3, 3) dy (counter) := Rand.Int (-3, 3) end if ... also for future updates - it would be nice if the screen doesn't get cleared when you lose and that a screenshot would be taken if it is your new highscore :wink: ----------------------------------- sport Sun Mar 28, 2004 3:58 pm ----------------------------------- It is a great game, nice work!!!!!! ----------------------------------- the_short1 Sun Mar 28, 2004 4:49 pm ----------------------------------- push the PRINT SCREEN key for u can it no tony... u mean just stay that way for u to save a screen shot rote??? anyways... i little glitch.,.. hahah... 2 balls stuck together and bounced around the screen together... kinda vibrating off each other... it was weird... but nhing u can fix ----------------------------------- Tony Sun Mar 28, 2004 5:07 pm ----------------------------------- to fix the stuck on glitch, you modify the spawing loop to also make sure that the new ball is within a certain distance of all the other balls ----------------------------------- Cervantes Sun Mar 28, 2004 6:41 pm ----------------------------------- nope :P the balls get stuck when they collide with each other, not because they spawn on top of each other (though that might do it too :?) the ball's get stuck in thoughtful's pool too, so I figure theres nothing I can do about it :? and tony, I was updating it really fast, seeing as how I had to leave very soon after I posted that. Now I must leave soon after I post this, so I'll fix it tommorow i guess :?