If I go with:
while ( musicIsPlaying && music != shit) {
guy.mosh();
}
While music is playing and isn't shit, then the guy will mosh.
It seems this would work, but the while loop doesn't allow for the music to end. Everything else is locked while the while loop is being executed.
Maybe an If/Else would be more practical in this sense.
if ( musicIsPlaying && musicGenre == metal) {
guy.mosh();
}
else if (musicGenre != metal) {
guy.boo();
}
else {
guy.wait();
}
Still just a possibility at this stage.
Thursday, 5 May 2011
Monday, 2 May 2011
Project 3 - Coding Exhibition
At this stage I'm going to go with Loops. Possibly a while loop. But maybe more of an If/Else.
Processing Description of While:
Controls a sequence of repetitions. The while structure executes a series of statements continuously while the expression is true. The expression must be updated during the repetitions or the program will never "break out" of while.
This function can be dangerous because the code inside the while() loop will not finish until the expression inside while() becomes true. It will lock out all other code from running (mouse events will not be updated, etc.) So be careful because this can lock up your code (and sometimes even the Processing environment itself) if used incorrectly.
Processing Description of If:
Allows the program to make a decision about which code to execute. If the test evaluates to true, the statements enclosed within the block are executed and if the test evaluates to false the statements are not executed.
Processing Description of Else:
Extends the if() structure allowing the program to choose between two or more block of code. It specifies a block of code to execute when the expression in if() is false.
Processing Description of For:
Controls a sequence of repetitions. A for structure has three parts: init, test, and update. Each part must be separated by a semi-colon ";". The loop continues until the test evaluates to false. When a for structure is executed, the following sequence of events occurs:
1. The init statement is executed
2. The test is evaluated to be true or false
3. If the test is true, jump to step 4. If the test is False, jump to step 6
4. Execute the statements within the block
5. Execute the update statement and jump to step 2
6. Exit the loop.
The only idea I have at this stage is moshing (headbanging) being a metaphor for a loop of some sort.
Processing Description of While:
Controls a sequence of repetitions. The while structure executes a series of statements continuously while the expression is true. The expression must be updated during the repetitions or the program will never "break out" of while.
This function can be dangerous because the code inside the while() loop will not finish until the expression inside while() becomes true. It will lock out all other code from running (mouse events will not be updated, etc.) So be careful because this can lock up your code (and sometimes even the Processing environment itself) if used incorrectly.
Processing Description of If:
Allows the program to make a decision about which code to execute. If the test evaluates to true, the statements enclosed within the block are executed and if the test evaluates to false the statements are not executed.
Processing Description of Else:
Extends the if() structure allowing the program to choose between two or more block of code. It specifies a block of code to execute when the expression in if() is false.
Processing Description of For:
Controls a sequence of repetitions. A for structure has three parts: init, test, and update. Each part must be separated by a semi-colon ";". The loop continues until the test evaluates to false. When a for structure is executed, the following sequence of events occurs:
1. The init statement is executed
2. The test is evaluated to be true or false
3. If the test is true, jump to step 4. If the test is False, jump to step 6
4. Execute the statements within the block
5. Execute the update statement and jump to step 2
6. Exit the loop.
The only idea I have at this stage is moshing (headbanging) being a metaphor for a loop of some sort.
Sunday, 1 May 2011
Final Musical Gluttony
I nearly got the single tone version to ascend and descend to match the colours but it was fairly boring anyway.
But I did get it to do what I wanted originally, which is add notes and play sequentially each time food is eaten. The more food = the longer the tune.
Here is the link
Reflecting on how this relates to transformation, the only transformation is the snakes length and the colour shifts. So not as transforming as I'd have liked but at least there is some.
But I did get it to do what I wanted originally, which is add notes and play sequentially each time food is eaten. The more food = the longer the tune.
Here is the link
Reflecting on how this relates to transformation, the only transformation is the snakes length and the colour shifts. So not as transforming as I'd have liked but at least there is some.
Saturday, 30 April 2011
Further Musical Gluttony Development
After some help from Tim, I managed to get the worm to eat/play the food/note and take on the color of the food/note.
I am now working on building a sequence of notes that the worm will hold the color of the last played note, until returning to white, after each food.
The main thing left to do is to change the length of the note as it takes too long to play the tune at this point.
I am now working on building a sequence of notes that the worm will hold the color of the last played note, until returning to white, after each food.
The main thing left to do is to change the length of the note as it takes too long to play the tune at this point.
Thursday, 28 April 2011
Musical Gluttony Development
I've inverted the color scheme and set food to colors indicating the note that will be added to the tune. Having trouble getting the audio to play chronologically, which is affecting me writing the color flash of the worm's body as it will relate to the audio code.
Although not working properly, I've posted it on openProcessing here.
I am hoping I can email this through to Angela as I'm working over the weekend and I think the Uni doors will be shut by the time I can get there after. It seems I'll need all the time I can get to get this to a point where I'm partially happy with it.
Although not working properly, I've posted it on openProcessing here.
I am hoping I can email this through to Angela as I'm working over the weekend and I think the Uni doors will be shut by the time I can get there after. It seems I'll need all the time I can get to get this to a point where I'm partially happy with it.
Wednesday, 20 April 2011
Review of Gluttony
Points to reconsider are as follows:
Hurts to look at - try different color schemes (no flashing food)
Too gamelike - food should only spawn once the old food is eaten (and once the music stops?)
My noises are too cartoony - eliminate them and try to, instead, make the snake flash the color of the food and play a tone associated to the color.
As the snake grows, the tune will get longer (incorporating more notes).
Hurts to look at - try different color schemes (no flashing food)
Too gamelike - food should only spawn once the old food is eaten (and once the music stops?)
My noises are too cartoony - eliminate them and try to, instead, make the snake flash the color of the food and play a tone associated to the color.
As the snake grows, the tune will get longer (incorporating more notes).
Thursday, 14 April 2011
Interim Final of Gluttony
I tried a few ways to get visual feedback from the eat and explosion, but to no avail. I'll continue trying over the break. Also tried adding an image of grass to the background, but my sounds started getting null pointer exceptions. I'll have to play around with it a bit more. I've settled with a blue background for now.
Subscribe to:
Posts (Atom)
