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

Username:   Password: 
 RegisterRegister   
 Level
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
upthescale




PostPosted: Tue May 09, 2006 2:04 pm   Post subject: Level

i hav a game with levels, my question is that when i get 20 points or whatever, there wil be more things falling down


i am using arrays, so how would i make it so when i hit the 10 or 15 or 20 or whatever iset the code as, more object wil lfall?
Sponsor
Sponsor
Sponsor
sponsor
[Gandalf]




PostPosted: Tue May 09, 2006 2:35 pm   Post subject: (No subject)

A simple if statement? Using upper(myArray)? Don't know, that may or may not help you, but you will have to be way more specific in your question to get a better answer. What code are you talking about?
Cervantes




PostPosted: Tue May 09, 2006 3:36 pm   Post subject: (No subject)

More stuff falling, eh? Let's say the amount of 'stuff' that falls is represented by the variable, 'x'.

Once you've accumulated 20 points, let's say we want to double the amount of 'stuff' that falls:
code:

x := 5
loop %main loop
    if points >= 20 then
        x := 10
    end if
end loop


Easy, yes?

I personally think a gradual increase in the stuff that falls is better, though. For that, just set x := points, or some mathematical expression involving points, such as
code:
f (points) = ln (2 * points)


That should answer your question.

However, if your question is what I think it is, that doesn't answer your question. (I sincerely hope you can see the great lengths you make people go to just to help you when you are vague in your question.)

If each thing that's falling is an element of an array and you want to make it so more things fall, you need to increase the size of your array. To do this, you need to use a Flexible Array.
upthescale




PostPosted: Tue May 09, 2006 7:48 pm   Post subject: (No subject)

thank you cervantes
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  [ 4 Posts ]
Jump to:   


Style:  
Search: