Jump to content

Search the Community

Showing results for tags 'javascript'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • News & Updates
    • Announcements
    • Suggestions & Feedback
  • MMO Hub
    • General Chat
    • Gamer's Lounge
    • Member's Lounge
    • Dev Lounge
  • MMO Corner
    • MMO and MMORPG
    • Host Listing
    • Server Listings
    • Server Recruitment
    • Server Reviews
  • User Hub
    • Support
    • Report
    • Contact Staff
  • Creative Corner
    • GFX
    • VFX
  • Merchant Corner
    • Marketplace
  • General Development Releases
    • Applications
  • Tutorials
    • Programming
    • Web Development
  • Wasteland
    • Archives

Categories

  • Creative Corner
    • GFX Releases
    • VFX Releases
    • Resources
  • MMO and MMORPG
    • World of Warcraft
    • Lineage 2
    • Minecraft
  • Webmasters
    • Content Management Systems
    • Addons
    • Scripts
    • Designs
    • Proxies
  • Applications
  • Gaming
    • World of Warcraft
    • Lineage 2
    • Minecraft
    • Emulation
    • Nulled Distributions
  • Marketplace
    • Marsh Designs
    • iDarts

Calendars

  • Community Calendar

Found 6 results

  1. Howdy guys, I'm very interested of what people will came up with this basic game. I may also have posted this in the wrong board as it's an game but also an learning JavaScript. This thread will be for those that want to code and show of there work/code. I have already set up most of the requirements. All you need to do is add the missing code. The reason for this because everyone will do it differently, the expert will probably be very similar, You have been employed by a web based game company to develop a simple Rock Paper Scissors game. The game is to be a single player game where the user can play against the computer. The requirements are: The game must be web based The user selects their move from one of three buttons The computer select it's move randomly The moves are displayed as images (provided below) The result must be displayed as text below the buttons - this must update instantly after the move The result must be either: "You win!", "You lose!" or "It's a draw!" The rules are: Paper beats Rock, Rock beats Scissors, Scirrors beats Paper The program must keep a tally of how many games have been played The program must keep a tally of how many wins, losses and draws there have been You will need to use your HTML and CSS skills in this project Here is a starting point you can base your game on: JavaScript function move(choicePlayer) { // Calculate computers move by generating a random number between 1 and 3 // Use a switch statement to conver the random number to either "rock", "scissors" or "paper" var choiceComputer= "?"; // Output the computers move var imageComputer = "<img src='ADD YOU IMAGE' />"; document.getElementById('computer').innerHTML = "computers move goes here"; // Output the players move var imagePlayer = "<img src='ADD YOU IMAGE' />"; document.getElementById('player').innerHTML = imagePlayer; // Calculate who won (rules: paper beats rock, rock beats scissors, scirrors beats paper or a draw) // Output the result document.getElementById('result').innerHTML = "result goes here"; } HTML <h1>Rock Paper Scissors</h1> <div id="computer"></div> <div id="player"></div> <p>Make your choice:</p> <button id="rock" onclick="move(this.id);">Rock</button> <button id="paper" onclick="move(this.id);">Paper</button> <button id="scissors" onclick="move(this.id);">Scissors</button> <p id="result"></p> CSS #player, #computer { border: 1px solid black; height: 100px; width: 150px; margin: 10px; } Good Luck, also let me know if the code is wrong I'm no smart myself
  2. Put this before </body> & </html> <?php if(isset($_COOKIE['accept'])) { //NO CODE HERE REQUIRED, PUT CODE IF THE COOKIE IS ACCEPTED. } else { ?> <div class="cookies"> By further use of the site you accept that we use <a href="http://www.allaboutcookies.org/" target="_blank">Cookies</a>.<br /> <a id="clickCookie">ACCEPT</a> </div> <?php } ?> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script> <script type="text/javascript" > $(document).ready(function(){ //Check if page is loaded $('.cookies').animate({'bottom': '0px'}, 1000); //Animate button up $("#clickCookie").click(function(){ var now = new Date(); now.setTime(now.getTime() + 1 * 3600 * 24000); document.cookie="accept=accepted; expires=" + now.toUTCString() + "; path=/"; //Cookie will be created, it stays for 1 day, the ACCEPT button won't show for 1 day. $('.cookies').animate({'bottom': '-40px'}, 1000); //Animate the button down when it's clicked, make value same as height. }); }); </script> Stylesheet: .cookies { text-align:center; position:fixed; bottom:-40px; width:100%; height:40px; background-color:rgba(255,255,255,0.4); } #clickCookie { cursor:pointer; /* Makes it act like a clickable button for the users. */ } -NOTE: No sessions are required for cookies, no need for "session_start();" =) IMG:
  3. Hello, In this tutorial I just wanna paste a very simple script for Rock, Paper, Scissors var userChoice = prompt("Do you choose rock, paper or scissors?"); var computerChoice = Math.random(); if (computerChoice < 0.34) { computerChoice = "rock"; } else if(computerChoice <= 0.67) { computerChoice = "paper"; } else { computerChoice = "scissors"; } console.log(computerChoice); var compare = function(choice1, choice2) { if (choice1 === choice2) { return "The result is a tie!"; } else if (choice1 === "rock") { if (choice2 === "scissors") { return "rock wins"; } else { return "paper wins"; } } else if (choice1 === "paper") { if (choice2 === "rock") { return "paper wins"; } else { return "scissors wins"; } } else if (choice1 === "scissors") { if (choice2 === "rock") { return "rock wins"; } else { return "scissors wins"; } } }; compare(userChoice, computerChoice); Any questions? you can put them in the reply I will try to answer on it
  4. Hello Lordcraft, I am in an urgent need of someone to help me with one small thing : 1) Making myBB registration automatic when you register on my website www.yhool.gg and fully functional (actually it lacks some things). Also "transfer" the already registered hundreds of members from the website database to the forum database (whatever the process). It's all done in PHP (of course). There are also workaround solutions possible. 2) If you are interested further, you could be the new web developer on the project too, reprogramming it from scratch with a framework. For more informations check the website carefully. www.yhool.gg
  5. Using target=”_blank” for links in an HTML page will generate errors when running code through the W3C validator. Well, if you are using the older Transitional document type it would not, but errors will for sure be reported for Strict document types. An easy and quick solution is to create a JavaScript handler for your links. This tutorials explains how to create an SEO-friendly (of course) W3С valid replacement for target=”_blank” by using only a few lines of jQuery code. Here are two easy solutions to solve the task. In both solutions we will walk through each link in a page and apply our handlers to them so they will open in a new window. You should use the code below in your <head>…</head> tag, i.e.: <head> ... <script type="text/javascript"> // Put the code here </script> </head> Or you may save it to a separate file and link it in the <head>…</head> tag, i.e.: <head> ... <script type="text/javascript" src="path-to-js-file.js"></script> </head> Solution 1 While the target attribute is depreciated by W3C Strict standards, it is available via the DOM object. For the first solution, you can apply target=”_blank” via JavaScript. It will open in a new window and still be W3C valid. Here is the code: $(document).ready(function(){ $('A[rel="_blank"]').each(function(){ $(this).attr('target', '_blank'); }); }); Solution 2 While the first solution is to apply ‘_blank’ value to a native link’s attribute ‘target’ via JavaScript, the second solution is to handle the click on the link and open it in a new window. Please note that both alternative methods are absolutely SEO friendly and W3C valid. The code for the second solution is: $(document).ready(function(){ $('A[rel="_blank"]').click(function(){ window.open($(this).attr('href')); return >false; }); }) That’s it Click the Demo button to see it in action.
  6. I'm trying to make my website work but the only part i got working is my forums but some parts are broken and my main page for my website index.php is broken.Well i'm creating a website but i can't seem to figure out why i can't end the script on this index.php.I get an error : Here's the script: [url=http://pastebin.com/rZBuhZ1R]http://pastebin.com/rZBuhZ1R Updated current one: [url=http://zarkmania.ucoz.com/index.php.txt]http://zarkmania.uco...m/index.php.txtIf you open it in Notepad++ and go at end of script and press enter, the script is not ended. I tried many ways but seems to not work.(I'm a beginner on php so this explains it)If you don't mind me if i update this thread with new issues on this website. I'm in need for help on php and by helping me and explaining how you fix it will help me a lot. If you help me i'll allow you a free mvp status on my website if you help and a free closed beta ticket to my server.
×