So I have this project for my class and all I have to do is display one movie and review and the second one under the first one. I think my formatting is incorrect and also my size values. Thanks in advance!
Now, to get both your movies displaying, use a for loop to iterate through the array and execute the text commands for each movie. If you don't remember how to iterate through arrays, re-watch the previous talk-through and/or Looping through Arrays. HintWhat's this?
for (var =; ; ) {
fill(84, 140, 209);
textAlign(CENTER, CENTER);
textSize(20);
text(, 200, *+);
textSize ();
text(, 200, *+);
My code...
var movies = [
{
title: "Puff the Magic Dragon",
review: "Best movie ever!!"
},
{
title: "Batman",
review: "Second best movie!!"
}
];
fill(84, 140, 209);
textAlign(CENTER, CENTER);
textSize(20);
text(movies[0].title, 200, 50);
fill(84, 140, 209);
textAlign(CENTER, CENTER);
textSize(20);
text(movies[0].review, 200, 100);
for (var movies = 100; 100; 100){
fill(84,140,209);
textAlign(CENTER, CENTER);
textSize(20);
text(movies[0].title, 200,100*100+50);
textSize (10);
text(movies[0].review, 200,100*100+100);
}