Computer Science Canada help with 1d game |
Author: | biggmak [ Thu Mar 20, 2003 5:14 pm ] |
Post subject: | help with 1d game |
im making a 1d game and theres a hill that i want to restrict the animations from comming in contact with this hill. i know how to set up an if statement to restric the character to stay within a box but not this hill. in the game something will be shot over the hill but i want the for loop for that object to exit when it comes in contact with this curve/hill. i hope you guys know what i mean.... |
Author: | Tony [ Thu Mar 20, 2003 5:25 pm ] |
Post subject: | |
it would be so much easier if people would read tutorials first http://www.compsci.ca/bbs/viewtopic.php?t=370 loops and more... Doesn't cover forloops, but I think it talks about them too. The important part - exit it works same way in forloops and regular once. |
Author: | biggmak [ Thu Mar 20, 2003 7:15 pm ] | ||
Post subject: | |||
buddy i know how to use loops, i was wondering if u could help me with restricting walls, and such for example in a 2d RPG game, where if a wall comes up the character can not go through it. i am aware if keeping the character in a 'BOX' but i can have him stop in front of objects that stick out of this box like buildings. i was told that i could use something like this, which would plot a point on the screen that would restrict the character from comming in contact with. could i connect these points to make a 'wall' so that the charcter can't be allowed to pass through these connected points
|
Author: | biggmak [ Thu Mar 20, 2003 7:19 pm ] |
Post subject: | |
"....but i CANT have him stop in front of objects sticking out of the main box....." i put can infront of cant in other reply |
Author: | Asok [ Thu Mar 20, 2003 7:20 pm ] |
Post subject: | |
this can be done with simple if statements surrounding the coordinates around your walls/buildings ie. if movingobjectxory = wallcoordinatexory then direction = "" %stop moving end if |