Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Cervantes' "Evasive Maneuvers" :P updated
Index -> Programming, Turing -> Turing Submissions
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Cervantes




PostPosted: Sat Mar 27, 2004 10:32 am   Post subject: 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 Smile
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 Thinking

Hope you like it



Evade the Circles.t
 Description:
UPDATED VERSION
credit to thoughtful for collision data

Download
 Filename:  Evade the Circles.t
 Filesize:  4.22 KB
 Downloaded:  295 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
recneps




PostPosted: Sat Mar 27, 2004 10:58 am   Post subject: (No subject)

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 Smile
Cervantes




PostPosted: Sat Mar 27, 2004 11:53 am   Post subject: (No subject)

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




PostPosted: Sat Mar 27, 2004 1:43 pm   Post subject: (No subject)

nice, I like the game Very Happy cool consept. It was preaty crazy when I got up to 12 balls after me Laughing

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 Confused

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)
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
the_short1




PostPosted: Sat Mar 27, 2004 2:14 pm   Post subject: (No subject)

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




PostPosted: Sat Mar 27, 2004 2:28 pm   Post subject: (No subject)

ya that happens sometimes. I should really iron out the bugs in this thing Thinking

jeeze, you guys get to 12 balls, 17 balls, I get to 7 Embarassed

tony -> yea it does suck when a ball spawns on top of you Laughing I might get around to fixing that, or someone could fix it for me Razz

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.



Evade the Circles - Collision Data - messed.t
 Description:
This program shows the strangness of the collision data.

Download
 Filename:  Evade the Circles - Collision Data - messed.t
 Filesize:  2.75 KB
 Downloaded:  134 Time(s)

the_short1




PostPosted: Sat Mar 27, 2004 9:40 pm   Post subject: (No subject)

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




PostPosted: Sat Mar 27, 2004 11:44 pm   Post subject: (No subject)

eh? the collision seems to be messed up, I'm not following the code Confused I'm guessing that optimized part is an attempt at something related to inertial forces Confused

and I don't see a space where dx/dy actually get changed Confused
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Sponsor
Sponsor
Sponsor
sponsor
jonos




PostPosted: Sat Mar 27, 2004 11:53 pm   Post subject: (No subject)

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




PostPosted: Sun Mar 28, 2004 12:37 am   Post subject: (No subject)

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




PostPosted: Sun Mar 28, 2004 1:02 am   Post subject: (No subject)

wow, this game is addictive Surprised

17, though I modded the game so that balls don't spawn within 100 pixels of me Laughing



EMss17.GIF
 Description:
 Filesize:  12 KB
 Viewed:  4513 Time(s)

EMss17.GIF


Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Cervantes




PostPosted: Sun Mar 28, 2004 10:20 am   Post subject: (No subject)

tony. not only are you a complete genius, but I am a total idiot Embarassed Crying or Very sad

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




PostPosted: Sun Mar 28, 2004 3:32 pm   Post subject: (No subject)

Laughing Cervantes - you're right about that idiot part Rolling Eyes

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.

code:

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
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
sport




PostPosted: Sun Mar 28, 2004 3:58 pm   Post subject: (No subject)

It is a great game, nice work!!!!!!
the_short1




PostPosted: Sun Mar 28, 2004 4:49 pm   Post subject: (No subject)

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
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 2  [ 17 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: