Computer Science Canada using whatdotcolour for my game |
Author: | weebly [ Thu Jun 05, 2008 9:17 pm ] |
Post subject: | using whatdotcolour for my game |
i need to use watdotcolour for my game that i m making. it is basically like a space game, where you move around a space ship and try to dodge asteroid, if the asteroid hits the ship, it's game over, if not, then game continues until the ship has dodged 200 asteroids. what i need to know is how to detect the colosion of the asteroid an the ship. the background colour of the display is black. someone told me i need to use whatdotcolour, but i dont knoe how. please respond ASAP, thank you please tell me if u need my code, i will post that after ![]() ![]() ![]() |
Author: | weebly [ Thu Jun 05, 2008 9:37 pm ] |
Post subject: | RE:using whatdotcolour for my game |
oh man, no one is answering ![]() |
Author: | weebly [ Thu Jun 05, 2008 10:06 pm ] |
Post subject: | RE:using whatdotcolour for my game |
ok, wow, u just confused me, dude, im a grade 9 student, this is my isp, please explain in simple words, given a code example, like u said 2 circles coliding, make a simple code for that and bit of explaination, and that will do it. and can u give me tips on how to check for collison, like, my background screen is black so do it say if whatdotcolour not = black, then put "game over" ? i need to understand the logic to it, and a bit of code example, but thnx for ur effort for trying to help me thnx |
Author: | Tony [ Thu Jun 05, 2008 10:12 pm ] |
Post subject: | RE:using whatdotcolour for my game |
Try to work it out on paper first. I've already posted a picture of a diagram, above, to get you started. |
Author: | weebly [ Thu Jun 05, 2008 10:14 pm ] |
Post subject: | RE:using whatdotcolour for my game |
k, thnx |
Author: | weebly [ Thu Jun 05, 2008 10:16 pm ] |
Post subject: | RE:using whatdotcolour for my game |
but 1 more question, how can u keep tract of the coordinate of the ship and asteroids, there is not only one asteroid there r many asteroid coming at once, so how do i kepp tract of each of their coordinate. i guess this is my main problem. i get the logic now |
Author: | weebly [ Thu Jun 05, 2008 10:19 pm ] |
Post subject: | RE:using whatdotcolour for my game |
"someone told me i need to use whatdotcolour, but i dont knoe how".<<< that someone was my programming teacher, lol, she knoes teaches all programming languages, gr9-12, java, c, c++, c+, turing, etc. so ya, and now back to my question. ![]() |
Author: | Tony [ Thu Jun 05, 2008 10:23 pm ] |
Post subject: | RE:using whatdotcolour for my game |
that requires arrays. Now, I realize that arrays are not usually in the scope of grade 9 material (grade 10 topic? depends on the school), but it's actually quite simple. If you read the tutorials (linked to from the Turing Walkthrough), arrays will make this much easier. |
Author: | Tony [ Thu Jun 05, 2008 10:24 pm ] |
Post subject: | Re: RE:using whatdotcolour for my game |
weebly @ Thu Jun 05, 2008 10:19 pm wrote: that someone was my programming teacher
Tell her to join the community. Maybe she'll learn something as well ![]() |
Author: | jeffgreco13 [ Fri Jun 06, 2008 8:35 am ] |
Post subject: | Re: using whatdotcolour for my game |
Tony's right your best bet is to create 2 arrays, one for asteroid's x-val and another for the y-val. and then run a procedure that randomly assigns values to each array. That way you'll have randomly placed asteroids, and the number of values you set will be the number of asteroids at one time. To make this program as good as it can be, it's gonna require you to reallly learn past waht you are being taught. Oh and about your teacher, we're smarter here!!! and always remember the height and width of your ship play a HUGE role in collision detection, think about it. |
Author: | Tony [ Fri Jun 06, 2008 9:07 am ] |
Post subject: | RE:using whatdotcolour for my game |
@jeffgreco13 -- I did not say to use parallel arrays. |
Author: | SNIPERDUDE [ Fri Jun 06, 2008 9:10 am ] |
Post subject: | RE:using whatdotcolour for my game |
types and records are usually best |
Author: | jeffgreco13 [ Fri Jun 06, 2008 9:33 am ] |
Post subject: | Re: RE:using whatdotcolour for my game |
Tony @ Fri Jun 06, 2008 9:07 am wrote: @jeffgreco13 -- I did not say to use parallel arrays.
What exactly are you suggesting Tony? I might be mistaken.. |
Author: | SNIPERDUDE [ Fri Jun 06, 2008 10:32 am ] | ||||||||
Post subject: | RE:using whatdotcolour for my game | ||||||||
he is saying making seperate arrays for x and y values wouldn't be as effective as using something like a record. So insted of:
it would be better if you used something like this:
then you could easily just call all the coordinates by using a line like this:
EDIT: It would also be effective if you put all of the objects' properties in the records too, to reduce the number of 'stray' variables lying around that involve the object as well. An example being:
...and do a similar thing with the spaceship's properties (except you wouldn't put that in an array, just use var Ship : ShipProp) |