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

Username:   Password: 
 RegisterRegister   
 help with 1d game
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
biggmak




PostPosted: 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....
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Thu Mar 20, 2003 5:25 pm   Post subject: (No 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.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
biggmak




PostPosted: Thu Mar 20, 2003 7:15 pm   Post subject: (No 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

code:
map (index)=
index (3x(400)+6)
biggmak




PostPosted: Thu Mar 20, 2003 7:19 pm   Post subject: (No 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
Asok




PostPosted: Thu Mar 20, 2003 7:20 pm   Post subject: (No 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
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: