BullyWiiHacks
Welcome dear guest! Very Happy

To start posting and being part of the BWH community, you simply need to register an account or log into an existing one.

If you do not wish to register at all, that's fine but there will be more advertisements. :/

You can probably see and download most content provided for regular members even without an account.

Your contributions will be greatly appreciated though, give it a shot and register today! thumbsup

Join the forum, it's quick and easy

BullyWiiHacks
Welcome dear guest! Very Happy

To start posting and being part of the BWH community, you simply need to register an account or log into an existing one.

If you do not wish to register at all, that's fine but there will be more advertisements. :/

You can probably see and download most content provided for regular members even without an account.

Your contributions will be greatly appreciated though, give it a shot and register today! thumbsup
BullyWiiHacks
Would you like to react to this message? Create an account in a few clicks or log in to continue.
BullyWiiHacks

Gaming, Modding & Programming

Important reminders:

- Click *HERE* for advanced forum search or check out the text field below on the front page for Google before posting
- NO support via private message (use the forum)
- Write meaningful topic titles
Site Translation
Latest topics
» Dropped Out of College to Pursue Web Dev and Life Pursuits in General
Quick Create Your Own Adventure Empty5/16/2024, 8:25 am by Bully@WiiPlaza

» Bully Made It Into a BIG Video 400K Views
Quick Create Your Own Adventure Empty4/7/2024, 6:58 am by Bully@WiiPlaza

» Wii Play Tanks
Quick Create Your Own Adventure Empty3/24/2024, 2:46 pm by helpmeout

» [Bypass Paywalls] (Global) @magnolia1234 - GitLab
Quick Create Your Own Adventure Empty3/18/2024, 3:55 am by Seth@WiiPlaza

» [Download] Mary Shelley's Frankenhole
Quick Create Your Own Adventure Empty3/16/2024, 8:29 am by Seth@WiiPlaza

» Completely Custom Modded Controllers (Undetectable)
Quick Create Your Own Adventure Empty3/5/2024, 1:55 pm by Shadow@BWH

» (Zombies) Drink perks code?
Quick Create Your Own Adventure Empty3/5/2024, 1:24 pm by Shadow@BWH

» Die Rückkehr zu STEAM und WARFACE
Quick Create Your Own Adventure Empty3/2/2024, 3:54 am by Seth@WiiPlaza

» First person hand model change?
Quick Create Your Own Adventure Empty2/28/2024, 4:53 am by Ad3lamac611

» {RELEASE} Field Raider Firefox v1.72 by Seth@WiiPlaza
Quick Create Your Own Adventure Empty2/21/2024, 8:52 am by naxil

Search
 
 

Display results as :
 


Rechercher Advanced Search

May 2024
MonTueWedThuFriSatSun
  12345
6789101112
13141516171819
20212223242526
2728293031  

Calendar Calendar

Country Statistics
Free counters!

You are not connected. Please login or register

Quick Create Your Own Adventure

Go down  Message [Page 1 of 1]

1Quick Create Your Own Adventure Empty Quick Create Your Own Adventure 12/2/2014, 5:15 am

Shadow@BWH

Shadow@BWH
 
 

It's always polite to ask your user if they are ready to play.
Using the confirm command, make sure your user is ready to play. For example, I would use the sentence "I am ready to play!". Add whatever phrase you would like in the confirm.

It will look like this.

Code:
confirm("I am ready to play!");

Now we will use prompt to ask a user for their age.

Code:
confirm("I am ready to play!");
var age = prompt("What's your age");

Then we will use an if/else statement based on the age of the user.

Code:
if(age <13)
{
   console.log("You are not allowed to play, but you take no responsibility!");
}
else
{
    console.log("Play on!")
}

Under all your previous code, print out what you want the game to say.

Code:
console.log("You are at a Rob Zombie concert, and you hear this lyric 'Lace my shoes off, start racing.'");

Next, your user is about to talk to Rob Zombie. Under your existing code, print out the storyline: "Suddenly, Rob stops and says, 'Who wants to race me?'"

Code:
 console.log("Suddenly, Rob stops and says, 'Who wants to race me?'");

Then declare a variable userAnswer. Make it equal a prompt that asks the user "Do you want to race Rob on stage?". This will be the question that you ask your user.

Code:
var userAnswer = prompt("Do you want to race Rob on stage?");

Now If userAnswer is "yes", print out: "You and Rob start racing. It's neck and neck! You win by a shoelace!" Otherwise, print out: "Oh no! Rob shakes his head and sings 'I set a pace, so I can race without pacing.'" (Remember) = is for assignment, and === is to check if things are equal!

Code:
if (userAnswer==="yes")
{
console.log("You and Rob start racing. It's neck and neck! You win by a shoelace!");
}
else
{
console.log("Oh no! Rob shakes his head and sings 'I set a pace, so I can race without pacing.'");

Create a variable called feedback and prompt the user to rate your game out of 10.

If feedback is greater than 8, print out: "Thank you! We should race at the next concert!"

Otherwise, print out:
"I'll keep practicing coding and racing."

Your code and game will look like this in the end.
Code:
confirm("I am ready to play!");
var age = prompt("What's your age");
if(age <13)
{
   console.log("You are not allowed to play, but you take no responsibility!");
}
else
{
    console.log("Play on!")
}
console.log("You are at a Rob Zombie concert, and you hear this lyric 'Lace my shoes off, start racing.'");
    console.log("Suddenly, Rob stops and says, 'Who wants to race me?'");
var userAnswer = prompt("Do you want to race Rob on stage?");
if (userAnswer==="yes")
{
console.log("You and Rob start racing. It's neck and neck! You win by a shoelace!");
}
else
{
console.log("Oh no! Rob shakes his head and sings 'I set a pace, so I can race without pacing.'");
}
var feedback = prompt("Please rate this game out of 10");
if (feedback >
{
console.log("Thank you! We should race at the next concert!") }
else
console.log("I'll keep practicing coding and racing.")


_________________
Quick Create Your Own Adventure BAjMdNS

Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum