addressalign-toparrow-leftarrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscontroller-playcrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobegmailgooglegroupshelp-with-circleimageimagesinstagramFill 1launch-new-window--smalllight-bulblinklocation-pinm-swarmSearchmailmessagesminusmoremuplabelShape 3 + Rectangle 1ShapeoutlookpersonJoin Group on CardStartprice-ribbonprintShapeShapeShapeShapeImported LayersImported LayersImported Layersshieldstartickettrashtriangle-downtriangle-uptwitteruserwarningyahoo

IGDA Victoria Message Board › First game code

First game code

Bruce_N_Smith
Bruce_N_Smith
Victoria, BC
Post #: 10
If you know someone who's comfortable with technology but knows nothing about programming, then tell them to check out Codecademy. It really makes it easy for a pure beginner to code and run their first text-based game in Javascript in a couple of hours!!

Getting Started

Choose Your Own Adventure
Bruce_N_Smith
Bruce_N_Smith
Victoria, BC
Post #: 11
Here's the end of the 2nd "Choose Your Own Adventure" course if you're interested:

// Confirm the user is ready to play!
confirm("I am ready to play!");
//Check Age
var age = prompt("What's your age?");
if (age <18)
{
console.log("Access Denied!!");
}
else
{
console.log("Great! Start the game here:");
}
//Story Introduction
console.log("Snow White and Batman were hanging out at the bus stop, waiting to go to the shops. There was a sale on and both needed some new threads. You've never really liked Batman. You walk up to him.");
//First Decision
console.log("Batman glares at you.");
var userAnswer = prompt("Are you feeling lucky, punk?");
//First Consequence
if (userAnswer==="yes")
{
console.log("Batman hits you very hard. It's Batman and you're you! Of course Batman wins!");
}
else
{
console.log("You did not say yes to feeling lucky. Good choice! You are a winner in the game of not getting beaten up by Batman.");
}
//Request Feedback on Game
var feedback = prompt("Enter a value between 0 and 10, 10 being the best!");
if (feedback >8)
{
console.log("This is just the beginning of my game empire. Stay tuned for more!");
}
else
{
console.log("I slaved away at this game and you gave me that score?! The nerve! Just you wait!");
}
Powered by mvnForum

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy