ftf841 wrote:
the coding for the home page of the bit company website:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>The Bit Company | Home</title> </head> <body link="#FFFF00" alink="#FFFF99" vlink="#FFEE00"> <table width="100%" height="100%" border="5" cellspacing="0" cellpadding="0"><tr><td> <table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="108" colspan="2"bgcolor="#404040" style="text-align: center"><a href="index.html"><img src="http://i48.tinypic.com/2gxmb2d.png" border="0" alt="The Bit Company"/></a></td> </tr> <tr height="100%"> <td width="20%" height="100%" bgcolor="#0099FF"> <table width="100%" height="100%"border="0" cellspacing="0" cellpadding="0"> <tr> <td height="30" style="color: #FFF;">Welcome!</td> </tr> <tr><!--This is a standard menu item--> <td height="30" background="http://i47.tinypic.com/zj72c9.png"><a href="frame/home.html" target="main_frame">Home</a></td> </tr><!--(end)--> <tr><!--This is a standard menu item--> <td height="30" background="http://i47.tinypic.com/zj72c9.png"><a href="frame/about.html" target="main_frame">About</a></td> </tr><!--(end)--> <tr><!--This is a standard menu item--> <td height="30" background="http://i47.tinypic.com/zj72c9.png"><a href="frame/bitos.html" target="main_frame">Bit OS</a></td> </tr><!--(end)--> <tr><!--This is a standard menu item--> <td height="30" background="http://i47.tinypic.com/zj72c9.png"><a href="frame/rpg.html" target="main_frame">Short Circuit</a></td> </tr><!--(end)--> <tr> <td><hr/></td> </tr> <tr> <td height="30" background="http://i47.tinypic.com/zj72c9.png"><a href="http://scratch.mit.edu/forums/viewtopic.php?id=97571&p=1" target="_blank">Our Forums Page</a></td> </tr> <tr height="100%"></tr> </table> </td> <td height="100%"> <!--Begin Content Area--> <iframe id="main_frame" frameborder="0" width="100%" height="500" name="main_frame" src="frame/home.html"></iframe> <!--End Content Area--> </td> </tr> <tr> <td colspan="2" bgcolor="#0099FF" height="11" style="font-size: 10px">© 2012 <a href="index.html">The Bit Company</a>. Our website is under development. Questions? Suggestions? See <a href="http://scratch.mit.edu/forums/viewtopic.php?id=97571&p=1" target="_blank">our forums page</a> or <a href="mailto:scratchtbc@gmail.com?subject=Your awesome website&body=Remember, our site is still under development and may not be complete yet. Any questions/comments emailed to us are posted directly to the forums.">email</a> us.</td> </tr> </table> </td> </tr> </table> </body> </html> <!-- Hosting24 Analytics Code --> <script type="text/javascript" src="http://stats.hosting24.com/count.php"></script> <!-- End Of Analytics Code -->
Is that hand-coded?
Offline
BirdByte wrote:
ftf841 wrote:
the coding for the home page of the bit company website:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>The Bit Company | Home</title> </head> <body link="#FFFF00" alink="#FFFF99" vlink="#FFEE00"> <table width="100%" height="100%" border="5" cellspacing="0" cellpadding="0"><tr><td> <table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="108" colspan="2"bgcolor="#404040" style="text-align: center"><a href="index.html"><img src="http://i48.tinypic.com/2gxmb2d.png" border="0" alt="The Bit Company"/></a></td> </tr> <tr height="100%"> <td width="20%" height="100%" bgcolor="#0099FF"> <table width="100%" height="100%"border="0" cellspacing="0" cellpadding="0"> <tr> <td height="30" style="color: #FFF;">Welcome!</td> </tr> <tr><!--This is a standard menu item--> <td height="30" background="http://i47.tinypic.com/zj72c9.png"><a href="frame/home.html" target="main_frame">Home</a></td> </tr><!--(end)--> <tr><!--This is a standard menu item--> <td height="30" background="http://i47.tinypic.com/zj72c9.png"><a href="frame/about.html" target="main_frame">About</a></td> </tr><!--(end)--> <tr><!--This is a standard menu item--> <td height="30" background="http://i47.tinypic.com/zj72c9.png"><a href="frame/bitos.html" target="main_frame">Bit OS</a></td> </tr><!--(end)--> <tr><!--This is a standard menu item--> <td height="30" background="http://i47.tinypic.com/zj72c9.png"><a href="frame/rpg.html" target="main_frame">Short Circuit</a></td> </tr><!--(end)--> <tr> <td><hr/></td> </tr> <tr> <td height="30" background="http://i47.tinypic.com/zj72c9.png"><a href="http://scratch.mit.edu/forums/viewtopic.php?id=97571&p=1" target="_blank">Our Forums Page</a></td> </tr> <tr height="100%"></tr> </table> </td> <td height="100%"> <!--Begin Content Area--> <iframe id="main_frame" frameborder="0" width="100%" height="500" name="main_frame" src="frame/home.html"></iframe> <!--End Content Area--> </td> </tr> <tr> <td colspan="2" bgcolor="#0099FF" height="11" style="font-size: 10px">© 2012 <a href="index.html">The Bit Company</a>. Our website is under development. Questions? Suggestions? See <a href="http://scratch.mit.edu/forums/viewtopic.php?id=97571&p=1" target="_blank">our forums page</a> or <a href="mailto:scratchtbc@gmail.com?subject=Your awesome website&body=Remember, our site is still under development and may not be complete yet. Any questions/comments emailed to us are posted directly to the forums.">email</a> us.</td> </tr> </table> </td> </tr> </table> </body> </html> <!-- Hosting24 Analytics Code --> <script type="text/javascript" src="http://stats.hosting24.com/count.php"></script> <!-- End Of Analytics Code -->Is that hand-coded?
yea
Offline
ftf841 wrote:
BirdByte wrote:
ftf841 wrote:
the coding for the home page of the bit company website:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>The Bit Company | Home</title> </head> <body link="#FFFF00" alink="#FFFF99" vlink="#FFEE00"> <table width="100%" height="100%" border="5" cellspacing="0" cellpadding="0"><tr><td> <table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="108" colspan="2"bgcolor="#404040" style="text-align: center"><a href="index.html"><img src="http://i48.tinypic.com/2gxmb2d.png" border="0" alt="The Bit Company"/></a></td> </tr> <tr height="100%"> <td width="20%" height="100%" bgcolor="#0099FF"> <table width="100%" height="100%"border="0" cellspacing="0" cellpadding="0"> <tr> <td height="30" style="color: #FFF;">Welcome!</td> </tr> <tr><!--This is a standard menu item--> <td height="30" background="http://i47.tinypic.com/zj72c9.png"><a href="frame/home.html" target="main_frame">Home</a></td> </tr><!--(end)--> <tr><!--This is a standard menu item--> <td height="30" background="http://i47.tinypic.com/zj72c9.png"><a href="frame/about.html" target="main_frame">About</a></td> </tr><!--(end)--> <tr><!--This is a standard menu item--> <td height="30" background="http://i47.tinypic.com/zj72c9.png"><a href="frame/bitos.html" target="main_frame">Bit OS</a></td> </tr><!--(end)--> <tr><!--This is a standard menu item--> <td height="30" background="http://i47.tinypic.com/zj72c9.png"><a href="frame/rpg.html" target="main_frame">Short Circuit</a></td> </tr><!--(end)--> <tr> <td><hr/></td> </tr> <tr> <td height="30" background="http://i47.tinypic.com/zj72c9.png"><a href="http://scratch.mit.edu/forums/viewtopic.php?id=97571&p=1" target="_blank">Our Forums Page</a></td> </tr> <tr height="100%"></tr> </table> </td> <td height="100%"> <!--Begin Content Area--> <iframe id="main_frame" frameborder="0" width="100%" height="500" name="main_frame" src="frame/home.html"></iframe> <!--End Content Area--> </td> </tr> <tr> <td colspan="2" bgcolor="#0099FF" height="11" style="font-size: 10px">© 2012 <a href="index.html">The Bit Company</a>. Our website is under development. Questions? Suggestions? See <a href="http://scratch.mit.edu/forums/viewtopic.php?id=97571&p=1" target="_blank">our forums page</a> or <a href="mailto:scratchtbc@gmail.com?subject=Your awesome website&body=Remember, our site is still under development and may not be complete yet. Any questions/comments emailed to us are posted directly to the forums.">email</a> us.</td> </tr> </table> </td> </tr> </table> </body> </html> <!-- Hosting24 Analytics Code --> <script type="text/javascript" src="http://stats.hosting24.com/count.php"></script> <!-- End Of Analytics Code -->Is that hand-coded?
yea
lot's of code isn't it
Offline
ftf841 wrote:
the coding for the home page of the bit company website:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>The Bit Company | Home</title> </head> <body link="#FFFF00" alink="#FFFF99" vlink="#FFEE00"> <table width="100%" height="100%" border="5" cellspacing="0" cellpadding="0"><tr><td> <table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="108" colspan="2"bgcolor="#404040" style="text-align: center"><a href="index.html"><img src="http://i48.tinypic.com/2gxmb2d.png" border="0" alt="The Bit Company"/></a></td> </tr> <tr height="100%"> <td width="20%" height="100%" bgcolor="#0099FF"> <table width="100%" height="100%"border="0" cellspacing="0" cellpadding="0"> <tr> <td height="30" style="color: #FFF;">Welcome!</td> </tr> <tr><!--This is a standard menu item--> <td height="30" background="http://i47.tinypic.com/zj72c9.png"><a href="frame/home.html" target="main_frame">Home</a></td> </tr><!--(end)--> <tr><!--This is a standard menu item--> <td height="30" background="http://i47.tinypic.com/zj72c9.png"><a href="frame/about.html" target="main_frame">About</a></td> </tr><!--(end)--> <tr><!--This is a standard menu item--> <td height="30" background="http://i47.tinypic.com/zj72c9.png"><a href="frame/bitos.html" target="main_frame">Bit OS</a></td> </tr><!--(end)--> <tr><!--This is a standard menu item--> <td height="30" background="http://i47.tinypic.com/zj72c9.png"><a href="frame/rpg.html" target="main_frame">Short Circuit</a></td> </tr><!--(end)--> <tr> <td><hr/></td> </tr> <tr> <td height="30" background="http://i47.tinypic.com/zj72c9.png"><a href="http://scratch.mit.edu/forums/viewtopic.php?id=97571&p=1" target="_blank">Our Forums Page</a></td> </tr> <tr height="100%"></tr> </table> </td> <td height="100%"> <!--Begin Content Area--> <iframe id="main_frame" frameborder="0" width="100%" height="500" name="main_frame" src="frame/home.html"></iframe> <!--End Content Area--> </td> </tr> <tr> <td colspan="2" bgcolor="#0099FF" height="11" style="font-size: 10px">© 2012 <a href="index.html">The Bit Company</a>. Our website is under development. Questions? Suggestions? See <a href="http://scratch.mit.edu/forums/viewtopic.php?id=97571&p=1" target="_blank">our forums page</a> or <a href="mailto:scratchtbc@gmail.com?subject=Your awesome website&body=Remember, our site is still under development and may not be complete yet. Any questions/comments emailed to us are posted directly to the forums.">email</a> us.</td> </tr> </table> </td> </tr> </table> </body> </html> <!-- Hosting24 Analytics Code --> <script type="text/javascript" src="http://stats.hosting24.com/count.php"></script> <!-- End Of Analytics Code -->
uhhh..... Ok First thing, you don't mix HTML with CSS, that's just plain wrong. 2ndly, you are misusing the table element.
Offline
well, since I'm bored, I might as well post the code for the homepage of my website.
<?php /* DOCUMENTATION------------------------------------------------/ * * (C) Copyright 2012 Eternity Incurakai, All Rights Reserved. * Project: EternityX Platform * * Code by: XenoK Xihelien * email: support@eternityinc-official.com * *---------------------------------------------------------------*/ session_start(); include "includes/constants.php"; $con = mysql_connect($DB_HOST, $DB_USER, $DB_PASSWORD); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db($DB_NAME, $con); $result = mysql_query("SELECT * FROM content WHERE name='latest-news'"); while($row = mysql_fetch_array($result)) { $latestnews = $row['content']; } mysql_close($con); ?> <!DOCTYPE html> <html lang="en"> <head> <!-- === START META DATA === --> <meta charset="UTF-8" /> <meta name="author" content="Eternity Incurakai" /> <meta name="description" content="The official Eternity Incurakai Website! Browse through the forums, blog, projects, and much more!" /> <meta name="keywords" content="eternity, eternity incurakai, games, projects, scratch projects, scratch company, game development company, eternity incurakai official website, artwork, programming team" /> <!-- === END META DATA === --> <title>Home / Eternity Incurakai</title> <!-- === START LINKS === --> <link rel="stylesheet" href="http://eternityinc-official.com/style/style.css" /> <link rel="icon" type="image/png" href="http://eternityinc-official.com/images/favicon.png" /> <link rel="apple-touch-icon" href="http://eternityinc-official.com/images/touchicon.png" /> <!-- === END LINKS === --> <!-- === START SCRIPTS === --> <script src="http://eternityinc-official.com/js/behavior.js"></script> <!-- === END SCRIPTS === --> </head> <body onload="active('home')"> <!-- === START HEADER === --> <header> <!-- === START LOGO === --> <div id="logo" role="banner"> <table><tr><td><img src="http://eternityinc-official.com/images/eternity-sign.png" alt="" height="30" width="30" /></td> <td><a href="http://eternityinc-official.com"><strong>Eternity Incurakai™</strong></a></td></tr></table> </div> <!-- === END LOGO === --> <!-- === START NAVIGAION === --> <nav role="navigation"> <ul id="navigation"> <li><a id="home" href="http://eternityinc-official.com">Home</a></li> <li><a id="users" href="http://eternityinc-official.com/userlist.php">Users</a></li> <?php if (isset($_SESSION['username'])) { $username = $_SESSION['username']; echo "<li><a onmouseover=\"showpanel()\" onmouseout=\"hidepanel()\" class=\"profile\" id=\"Profile\" href=\"http://eternityinc-official.com/dashboard.php\">$username</a></li>"; } else { echo "<li><a class=\"profile\" id=\"Login\" href=\"http://eternityinc-official.com/login.php\">Login</a></li>"; } ?> </ul> </nav> <!-- === END NAVIGATION === --> </header> <div id="userpanel" onmouseover="showpanel()" onmouseout="hidepanel()"> <a href="<?php echo 'http://eternityinc-official.com/users/' . $username;?>">Profile</a><br /> <a href="http://eternityinc-official.com/logout.php">Logout</a> </div> <!-- === END HEADER === --> <!-- === START MAIN CONTENT === --> <div id="container"> <article role="main"> <h1>Welcome to Eternity Incurakai!</h1> <section> <p>Welcome to the official Eternity Incurakai Website! Home to all things Eternity! What is Eternity Incurakai? It is one of MIT Scratch's biggest collaborations! We work to create projects in the form of artwork, tutorials, games, and more to become the very best at what we do!</p> </section> <section> <p>Looking to <a href="apply.php">apply</a> to join Eternity Incurakai? Visit our application page! Please keep in mind, that entry does not guarantee your acceptance into Eternity Incurakaki.</p> </section> <section> <p> Do you have a question, comment, or concern? Feel free to <a href="contact.php">contact us</a> on our contact page, found at the bottom of everypage on the website! </section> </article> <aside role="complementary"> <section class="latest-news"> <h2>Latest News:</h2> <p><?php echo $latestnews; ?></p> </section> </aside> </div> <!-- === END MAIN CONTENT === --> <!-- === START FOOTER === --> <footer> <div id="copyright" role="contentinfo"> <small>© Copyright 2012 Eternity Incurakai, All Rights Reserved.</small> </div> <nav role="navigation"> <ul id="footer-links"> <li><a href="http://eternityinc-official.com/contact.php">Contact Us</a></li> <li><a href="http://eternityinc-official.com/donate.php">Donate</a></li> <li><a href="http://eternityinc-official.com/apply.php">Apply</a></li> <li><a href="http://eternityinc-official.com/guidelines.php">Society Guidelines</a></li> <li><a href="http://eternityinc-official.com/privacy-policy.php">Privacy Policy</a></li> </ul> </nav> </footer> <!-- === END FOOTER === --> </body> </html>
the header and footer are actually in separate files, and are included into the main file with php include statements. I've set up both a stylesheet to correctly use CSS to style the site, I can post the stylesheet here too, as it's a good piece of my work as well. I also have an apple-touch-icon link, which controls what appears on the homescreen of an idevice when added as a bookmark.
Offline
So I could edit Punbb-hosting easily without a CSS tab by adding the CSS right into the HTML?
Offline
BirdByte wrote:
mythbusteranimator wrote:
So I could edit Punbb-hosting easily without a CSS tab by adding the CSS right into the HTML?
Edit PunBB-Hosting? Is that even possible?
Oh yeah, it is. Under templates, you can do that. You just can't edit the main layout (ie get rid of the forum and only use a text website), because that would be an IOS violation or whatever.
Offline
mythbusteranimator wrote:
BirdByte wrote:
mythbusteranimator wrote:
So I could edit Punbb-hosting easily without a CSS tab by adding the CSS right into the HTML?
Edit PunBB-Hosting? Is that even possible?
Oh yeah, it is. Under templates, you can do that. You just can't edit the main layout (ie get rid of the forum and only use a text website), because that would be an IOS violation or whatever.
Add a <style></style> tag just above </head> and add CSS inside, I think.
Offline
BirdByte wrote:
mythbusteranimator wrote:
BirdByte wrote:
Edit PunBB-Hosting? Is that even possible?Oh yeah, it is. Under templates, you can do that. You just can't edit the main layout (ie get rid of the forum and only use a text website), because that would be an IOS violation or whatever.
Add a <style></style> tag just above </head> and add CSS inside, I think.
Cool. Thanks!
Offline
I'm working on something :3
No one on Scratch will be able to use it
Offline
funelephant wrote:
I'm working on something :3
No one on Scratch will be able to use it
Why?
Offline
After practising on many different websites, I'm finally making myself a decent homepage.
jji7skyline.tk
Offline
jji7skyline wrote:
After practising on many different websites, I'm finally making myself a decent homepage.
jji7skyline.tk
Cool!
But when you do that...do you upload the notepad file to the TK site?
Offline
mythbusteranimator wrote:
jji7skyline wrote:
After practising on many different websites, I'm finally making myself a decent homepage.
jji7skyline.tkCool!
But when you do that...do you upload the notepad file to the TK site?
the TK is just a domain name. I upload the HTML/PHP (I used PHP in this case) file via FTP to my 000webhost web server. The domain name simply points to the server.
Offline
your top bar thingy is displaced by 8 pixels too much to the right (mac, safari 6.0.1), bird
Last edited by Laternenpfahl (2012-09-20 21:14:24)
Offline
I'm not quite sure what you mean, I also use the same OS and browser version, but don't see any problems
Offline
How do I import something like this in my site?
Offline
I'm pretty sure it's like this.
<script type="text/javascript"> scale(0.5, 0.5); var xv = 0; var yv = 0; var xpos = 375; var ypos = 0; var bounce1 = false; var criticalSpeed = false; var messageStay = false; var fuel = 100; var keys = []; var keyPressed = function() { keys[keyCode] = true; }; var keyReleased = function() { keys[keyCode] = false; }; var draw = function() { background(0, 0, 0); //board of controls fill(177, 219, 85); stroke(47, 222, 207); rect(587,140,186,152); var font = createFont ("Gabriola", 16); textFont(font, 29); fill(255, 0, 13); text("X velocity: " + abs(round(xv)), 600, 176); text("Y velocity: " + abs(round(yv)), 600, 209); text("Fuel left: " + fuel, 600, 245); if (yv > 6) { text("CRITICAL SPEED!", 600, 275); criticalSpeed = true; } else { if (!messageStay) { criticalSpeed = false; } } //stars noStroke(); fill(255, 255, 255); ellipse(37,75,10,10); ellipse(65,202,8,8); ellipse(192,160,14,14); ellipse(359, 103, 7, 7); ellipse(403, 521, 13, 13); ellipse(582, 289, 11, 11); ellipse(785, 132, 6, 6); ellipse(18, 402, 8, 8); ellipse(59, 312, 11, 11); ellipse(285, 208, 10, 10); ellipse(592, 121, 7, 7); ellipse(236, 55, 11, 11); ellipse(271, 412, 14, 14); ellipse(381, 337, 9, 9); ellipse(378, 150, 15, 15); ellipse(562, 15, 11, 11); ellipse(700, 453, 9, 9); ellipse(453, 270, 12, 12); ellipse(533, 310, 7, 7); ellipse(754, 68, 14, 14); ellipse(55, 463, 13, 13); ellipse(98, 365, 8, 8); ellipse(481, 454, 9, 9); ellipse(299, 150, 7, 7); ellipse(218, 324, 9, 9); ellipse(173, 402, 10, 10); ellipse(147, 244, 13, 13); ellipse(153, 204, 9, 9); ellipse(50, 121, 14, 14); ellipse(133, 13, 12, 12); ellipse(120, 82, 6, 6); ellipse(1, 154, 8, 8); ellipse(211, 533, 8, 8); ellipse(320, 477, 10, 10); ellipse(467, 176, 11, 11); ellipse(505, 48, 13, 13); ellipse(447, 35, 9, 9); ellipse(315, 1, 9, 9); ellipse(332, 556, 10, 10); ellipse(636, 500, 11, 11); ellipse(569, 423, 8, 8); ellipse(672, 72, 7, 7); ellipse(100, 568, 10, 10); ellipse(500, 586, 8, 8); ellipse(707, 552, 12, 12); ellipse(598, 483, 7, 7); ellipse(793, 520, 13, 13); ellipse(772, 356, 9, 9); //planet surface stroke(255, 204, 0); fill(235, 135, 14); rect(0,600,1078,327); //Spaceship //rocket booster if (!messageStay) { noStroke(); fill(255, 81, 0); triangle(xpos + 38, ypos + 15, xpos + 17, ypos + 63, xpos + 59, ypos + 63); stroke(0, 0, 0); strokeWeight(5); line(xpos + 75, ypos + 43, xpos, ypos + 43); //bottom rectangle strokeWeight(1); stroke(255, 0, 0); fill(169, 166, 173); rect(xpos,ypos,75,40); stroke(143, 124, 124); strokeWeight(3); rect(xpos - 2,ypos - 78, 79, 76); stroke(87, 70, 70); ellipse(xpos + 37,ypos - 41,72,73); strokeWeight(1.25); fill(31, 28, 28); triangle(xpos + 61, ypos - 55, xpos + 42, ypos + -62, xpos + 49, ypos + -39); triangle(xpos + 14, ypos - 55, xpos + 32, ypos + -62, xpos + 26, ypos + -39); strokeWeight(2); fill(169, 166, 173); rect(xpos + 29,ypos + -32,17,17); strokeWeight(1.35); fill(255, 0, 0); rect(xpos + 8, ypos + 10, 20, 13); fill(255, 255, 255); rect(xpos + 8, ypos + 10, 20, 10); fill(255, 0, 0); rect(xpos + 8, ypos + 10, 20, 7); fill(255, 255, 255); rect(xpos + 8, ypos + 10, 20, 4); fill(255, 0, 0); rect(xpos + 8, ypos + 10, 20, 1); fill(0, 13, 255); rect(xpos + 8, ypos + 10, 7, 6); fill(148, 135, 135); ellipse(xpos + 66, ypos + -88, 13, 21); fill(153, 130, 130); ellipse(xpos + 23, ypos + -82, 18, 18); stroke(110, 106, 106); line(xpos + 66, ypos + -87, xpos + 81, ypos + -93); stroke(92, 91, 91); fill(54, 47, 47); ellipse(xpos + 22, ypos + -85, 6, 6); stroke(205, 0, 0); strokeWeight(3); line(xpos + 76, ypos + 2, xpos + 94, ypos + 11); line(xpos + 0, ypos + 2, xpos + -19, ypos + 11); line(xpos + -20, ypos + 11, xpos + -40, ypos + 74); line(xpos + 95, ypos + 11, xpos + 115, ypos + 74); strokeWeight(3); line(xpos + 127, ypos + 74, xpos + 103, ypos + 74); line(xpos + -51, ypos + 74, xpos + -28, ypos + 74); strokeWeight(1.35); stroke(255, 0, 0); fill(0, 0, 0); triangle(xpos + 77, ypos + 4, xpos + 93, ypos + 12, xpos + 76, ypos + 25); triangle(xpos + -1, ypos + 4, xpos + -19, ypos + 12, xpos + 0, ypos + 25); triangle(xpos + 100, ypos + 34, xpos + 93, ypos + 12, xpos + 76, ypos + 26); triangle(xpos + -27, ypos + 34, xpos + -19, ypos + 13, xpos + 1, ypos + 28); } //for rocket propulsion if (!messageStay) { if (keyIsPressed && keys[UP]) { if (fuel > 0) { fill(255, 0, 0); stroke(255, 17, 0); //fill(250, 108, 13); //ellipse(xpos + 39, ypos + 116, 19, 52); fill(255, 68, 0); ellipse(xpos + 40, ypos + 97, 26, 49); fill(255, 0, 0); ellipse(xpos + 39, ypos + 80, 37, 34); fill(250, 168, 5); triangle(xpos + 55, ypos + 66, xpos + 40, ypos + 151, xpos + 23, ypos + 65); yv = yv - 1.5; fuel -= 2; } } if (keyIsPressed && keys[DOWN]) { if (fuel > 0) { yv = yv + 1; //should I do this function? fuel -= 1; } } if (keyIsPressed && keys[LEFT]) { if (fuel > 0) { xv = xv - 1; fuel -= 1; } } if (keyIsPressed && keys[RIGHT]) { if (fuel > 0) { xv = xv + 1; fuel -= 1; } } } if (xpos < 25) { xv = abs(xv); } if (xpos > 700) { xv = abs(xv) * -1; } if (ypos < 100) { yv = abs(yv); } if (ypos > 525) { yv = abs(yv) * -1; } xv = xv * 0.9; yv = yv * 0.9; xpos += xv; ypos += yv; yv = yv + 1.4; if (criticalSpeed && ypos > 524) { yv = abs(yv) * 0; fill(255, 0, 0); textSize(50); text ("CRASH LANDING", 200,200); text ("CREW KILLED", 200, 250); messageStay = true; //Bent-up Spaceship noStroke(); fill(255, 81, 0); triangle(xpos + 42, ypos + 24, xpos + 17, ypos + 68, xpos + 59, ypos + 74); stroke(0, 0, 0); strokeWeight(5); line(xpos + 75, ypos + 43, xpos, ypos + 43); //bottom rectangle strokeWeight(1); stroke(255, 0, 0); fill(169, 166, 173); rect(xpos,ypos + 18,75,40); stroke(143, 124, 124); strokeWeight(3); //Top rectangle rect(xpos + 7,ypos - 47, 80, 76); stroke(87, 70, 70); ellipse(xpos + 49,ypos + -15,71,65); strokeWeight(1.25); fill(31, 28, 28); triangle(xpos + 77, ypos - 24, xpos + 63, ypos + -36, xpos + 49, ypos + -22); triangle(xpos + 14, ypos + -18, xpos + 32, ypos + -9, xpos + 26, ypos + -29); strokeWeight(2); fill(169, 166, 173); rect(xpos + 41,ypos + -12,23,14); strokeWeight(1.35); fill(255, 0, 0); rect(xpos + 9, ypos + 33, 20, 13); fill(255, 255, 255); rect(xpos + 8, ypos + 38, 20, 10); fill(255, 0, 0); rect(xpos + 12, ypos + 38, 20, 7); fill(255, 255, 255); rect(xpos + 13, ypos + 38, 20, 4); fill(255, 0, 0); rect(xpos + 8, ypos + 34, 20, 1); fill(0, 13, 255); rect(xpos + 11, ypos + 37, 7, 6); fill(148, 135, 135); ellipse(xpos + 126, ypos + 66, 26, 16); fill(153, 130, 130); ellipse(xpos + 22, ypos + -54, 18, 14); stroke(110, 106, 106); line(xpos + 142, ypos + 34, xpos + 118, ypos + 69); stroke(92, 91, 91); fill(54, 47, 47); ellipse(xpos + -69, ypos + 71, 10, 4); stroke(205, 0, 0); strokeWeight(3); line(xpos + 95, ypos + 19, xpos + 91, ypos + 24); line(xpos + -2, ypos + 67, xpos + 1, ypos + 44); line(xpos + 4, ypos + 44, xpos + -41, ypos + 73); line(xpos + 130, ypos + 23, xpos + 96, ypos + 74); noStroke(); fill(0, 0, 0); ellipse(xpos + 5, ypos + 14, 13, 30); triangle(xpos + 91, ypos + 31, xpos + 91, ypos + -2, xpos + 84, ypos + 12); stroke(205, 0, 0); strokeWeight(3); line(xpos + 144, ypos + 45, xpos + 80, ypos + 71); line(xpos + 40, ypos + 65, xpos + 87, ypos + 73); line(xpos + 115, ypos + 67, xpos + 87, ypos + 73); line(xpos + -51, ypos + 68, xpos + -28, ypos + 74); strokeWeight(1.35); stroke(255, 0, 0); fill(0, 0, 0); triangle(xpos + 81, ypos + 38, xpos + 89, ypos + 59, xpos + 64, ypos + 60); triangle(xpos + 14, ypos + 17, xpos + -19, ypos + 25, xpos + 0, ypos + 41); triangle(xpos + 118, ypos + 57, xpos + 94, ypos + 26, xpos + 89, ypos + 38); triangle(xpos + -27, ypos + 51, xpos + -19, ypos + 36, xpos + 1, ypos + 36); } if (ypos > 525) { yv = abs(yv) * -0.6; if (bounce1) { ypos = 525; yv = abs(yv) * 0; fuel = 0; } bounce1 = true; } if (fuel < 0) { fuel = 0; } //End of Draw loop }; </script>
EDIT: That doesn't seem to work on it's own, you might have to make a canvas element first.
Last edited by jji7skyline (2012-09-20 21:59:44)
Offline
jji7skyline wrote:
I'm pretty sure it's like this.
Code:
<script type="text/javascript"> scale(0.5, 0.5); var xv = 0; var yv = 0; var xpos = 375; var ypos = 0; var bounce1 = false; var criticalSpeed = false; var messageStay = false; var fuel = 100; var keys = []; var keyPressed = function() { keys[keyCode] = true; }; var keyReleased = function() { keys[keyCode] = false; }; var draw = function() { background(0, 0, 0); //board of controls fill(177, 219, 85); stroke(47, 222, 207); rect(587,140,186,152); var font = createFont ("Gabriola", 16); textFont(font, 29); fill(255, 0, 13); text("X velocity: " + abs(round(xv)), 600, 176); text("Y velocity: " + abs(round(yv)), 600, 209); text("Fuel left: " + fuel, 600, 245); if (yv > 6) { text("CRITICAL SPEED!", 600, 275); criticalSpeed = true; } else { if (!messageStay) { criticalSpeed = false; } } //stars noStroke(); fill(255, 255, 255); ellipse(37,75,10,10); ellipse(65,202,8,8); ellipse(192,160,14,14); ellipse(359, 103, 7, 7); ellipse(403, 521, 13, 13); ellipse(582, 289, 11, 11); ellipse(785, 132, 6, 6); ellipse(18, 402, 8, 8); ellipse(59, 312, 11, 11); ellipse(285, 208, 10, 10); ellipse(592, 121, 7, 7); ellipse(236, 55, 11, 11); ellipse(271, 412, 14, 14); ellipse(381, 337, 9, 9); ellipse(378, 150, 15, 15); ellipse(562, 15, 11, 11); ellipse(700, 453, 9, 9); ellipse(453, 270, 12, 12); ellipse(533, 310, 7, 7); ellipse(754, 68, 14, 14); ellipse(55, 463, 13, 13); ellipse(98, 365, 8, 8); ellipse(481, 454, 9, 9); ellipse(299, 150, 7, 7); ellipse(218, 324, 9, 9); ellipse(173, 402, 10, 10); ellipse(147, 244, 13, 13); ellipse(153, 204, 9, 9); ellipse(50, 121, 14, 14); ellipse(133, 13, 12, 12); ellipse(120, 82, 6, 6); ellipse(1, 154, 8, 8); ellipse(211, 533, 8, 8); ellipse(320, 477, 10, 10); ellipse(467, 176, 11, 11); ellipse(505, 48, 13, 13); ellipse(447, 35, 9, 9); ellipse(315, 1, 9, 9); ellipse(332, 556, 10, 10); ellipse(636, 500, 11, 11); ellipse(569, 423, 8, 8); ellipse(672, 72, 7, 7); ellipse(100, 568, 10, 10); ellipse(500, 586, 8, 8); ellipse(707, 552, 12, 12); ellipse(598, 483, 7, 7); ellipse(793, 520, 13, 13); ellipse(772, 356, 9, 9); //planet surface stroke(255, 204, 0); fill(235, 135, 14); rect(0,600,1078,327); //Spaceship //rocket booster if (!messageStay) { noStroke(); fill(255, 81, 0); triangle(xpos + 38, ypos + 15, xpos + 17, ypos + 63, xpos + 59, ypos + 63); stroke(0, 0, 0); strokeWeight(5); line(xpos + 75, ypos + 43, xpos, ypos + 43); //bottom rectangle strokeWeight(1); stroke(255, 0, 0); fill(169, 166, 173); rect(xpos,ypos,75,40); stroke(143, 124, 124); strokeWeight(3); rect(xpos - 2,ypos - 78, 79, 76); stroke(87, 70, 70); ellipse(xpos + 37,ypos - 41,72,73); strokeWeight(1.25); fill(31, 28, 28); triangle(xpos + 61, ypos - 55, xpos + 42, ypos + -62, xpos + 49, ypos + -39); triangle(xpos + 14, ypos - 55, xpos + 32, ypos + -62, xpos + 26, ypos + -39); strokeWeight(2); fill(169, 166, 173); rect(xpos + 29,ypos + -32,17,17); strokeWeight(1.35); fill(255, 0, 0); rect(xpos + 8, ypos + 10, 20, 13); fill(255, 255, 255); rect(xpos + 8, ypos + 10, 20, 10); fill(255, 0, 0); rect(xpos + 8, ypos + 10, 20, 7); fill(255, 255, 255); rect(xpos + 8, ypos + 10, 20, 4); fill(255, 0, 0); rect(xpos + 8, ypos + 10, 20, 1); fill(0, 13, 255); rect(xpos + 8, ypos + 10, 7, 6); fill(148, 135, 135); ellipse(xpos + 66, ypos + -88, 13, 21); fill(153, 130, 130); ellipse(xpos + 23, ypos + -82, 18, 18); stroke(110, 106, 106); line(xpos + 66, ypos + -87, xpos + 81, ypos + -93); stroke(92, 91, 91); fill(54, 47, 47); ellipse(xpos + 22, ypos + -85, 6, 6); stroke(205, 0, 0); strokeWeight(3); line(xpos + 76, ypos + 2, xpos + 94, ypos + 11); line(xpos + 0, ypos + 2, xpos + -19, ypos + 11); line(xpos + -20, ypos + 11, xpos + -40, ypos + 74); line(xpos + 95, ypos + 11, xpos + 115, ypos + 74); strokeWeight(3); line(xpos + 127, ypos + 74, xpos + 103, ypos + 74); line(xpos + -51, ypos + 74, xpos + -28, ypos + 74); strokeWeight(1.35); stroke(255, 0, 0); fill(0, 0, 0); triangle(xpos + 77, ypos + 4, xpos + 93, ypos + 12, xpos + 76, ypos + 25); triangle(xpos + -1, ypos + 4, xpos + -19, ypos + 12, xpos + 0, ypos + 25); triangle(xpos + 100, ypos + 34, xpos + 93, ypos + 12, xpos + 76, ypos + 26); triangle(xpos + -27, ypos + 34, xpos + -19, ypos + 13, xpos + 1, ypos + 28); } //for rocket propulsion if (!messageStay) { if (keyIsPressed && keys[UP]) { if (fuel > 0) { fill(255, 0, 0); stroke(255, 17, 0); //fill(250, 108, 13); //ellipse(xpos + 39, ypos + 116, 19, 52); fill(255, 68, 0); ellipse(xpos + 40, ypos + 97, 26, 49); fill(255, 0, 0); ellipse(xpos + 39, ypos + 80, 37, 34); fill(250, 168, 5); triangle(xpos + 55, ypos + 66, xpos + 40, ypos + 151, xpos + 23, ypos + 65); yv = yv - 1.5; fuel -= 2; } } if (keyIsPressed && keys[DOWN]) { if (fuel > 0) { yv = yv + 1; //should I do this function? fuel -= 1; } } if (keyIsPressed && keys[LEFT]) { if (fuel > 0) { xv = xv - 1; fuel -= 1; } } if (keyIsPressed && keys[RIGHT]) { if (fuel > 0) { xv = xv + 1; fuel -= 1; } } } if (xpos < 25) { xv = abs(xv); } if (xpos > 700) { xv = abs(xv) * -1; } if (ypos < 100) { yv = abs(yv); } if (ypos > 525) { yv = abs(yv) * -1; } xv = xv * 0.9; yv = yv * 0.9; xpos += xv; ypos += yv; yv = yv + 1.4; if (criticalSpeed && ypos > 524) { yv = abs(yv) * 0; fill(255, 0, 0); textSize(50); text ("CRASH LANDING", 200,200); text ("CREW KILLED", 200, 250); messageStay = true; //Bent-up Spaceship noStroke(); fill(255, 81, 0); triangle(xpos + 42, ypos + 24, xpos + 17, ypos + 68, xpos + 59, ypos + 74); stroke(0, 0, 0); strokeWeight(5); line(xpos + 75, ypos + 43, xpos, ypos + 43); //bottom rectangle strokeWeight(1); stroke(255, 0, 0); fill(169, 166, 173); rect(xpos,ypos + 18,75,40); stroke(143, 124, 124); strokeWeight(3); //Top rectangle rect(xpos + 7,ypos - 47, 80, 76); stroke(87, 70, 70); ellipse(xpos + 49,ypos + -15,71,65); strokeWeight(1.25); fill(31, 28, 28); triangle(xpos + 77, ypos - 24, xpos + 63, ypos + -36, xpos + 49, ypos + -22); triangle(xpos + 14, ypos + -18, xpos + 32, ypos + -9, xpos + 26, ypos + -29); strokeWeight(2); fill(169, 166, 173); rect(xpos + 41,ypos + -12,23,14); strokeWeight(1.35); fill(255, 0, 0); rect(xpos + 9, ypos + 33, 20, 13); fill(255, 255, 255); rect(xpos + 8, ypos + 38, 20, 10); fill(255, 0, 0); rect(xpos + 12, ypos + 38, 20, 7); fill(255, 255, 255); rect(xpos + 13, ypos + 38, 20, 4); fill(255, 0, 0); rect(xpos + 8, ypos + 34, 20, 1); fill(0, 13, 255); rect(xpos + 11, ypos + 37, 7, 6); fill(148, 135, 135); ellipse(xpos + 126, ypos + 66, 26, 16); fill(153, 130, 130); ellipse(xpos + 22, ypos + -54, 18, 14); stroke(110, 106, 106); line(xpos + 142, ypos + 34, xpos + 118, ypos + 69); stroke(92, 91, 91); fill(54, 47, 47); ellipse(xpos + -69, ypos + 71, 10, 4); stroke(205, 0, 0); strokeWeight(3); line(xpos + 95, ypos + 19, xpos + 91, ypos + 24); line(xpos + -2, ypos + 67, xpos + 1, ypos + 44); line(xpos + 4, ypos + 44, xpos + -41, ypos + 73); line(xpos + 130, ypos + 23, xpos + 96, ypos + 74); noStroke(); fill(0, 0, 0); ellipse(xpos + 5, ypos + 14, 13, 30); triangle(xpos + 91, ypos + 31, xpos + 91, ypos + -2, xpos + 84, ypos + 12); stroke(205, 0, 0); strokeWeight(3); line(xpos + 144, ypos + 45, xpos + 80, ypos + 71); line(xpos + 40, ypos + 65, xpos + 87, ypos + 73); line(xpos + 115, ypos + 67, xpos + 87, ypos + 73); line(xpos + -51, ypos + 68, xpos + -28, ypos + 74); strokeWeight(1.35); stroke(255, 0, 0); fill(0, 0, 0); triangle(xpos + 81, ypos + 38, xpos + 89, ypos + 59, xpos + 64, ypos + 60); triangle(xpos + 14, ypos + 17, xpos + -19, ypos + 25, xpos + 0, ypos + 41); triangle(xpos + 118, ypos + 57, xpos + 94, ypos + 26, xpos + 89, ypos + 38); triangle(xpos + -27, ypos + 51, xpos + -19, ypos + 36, xpos + 1, ypos + 36); } if (ypos > 525) { yv = abs(yv) * -0.6; if (bounce1) { ypos = 525; yv = abs(yv) * 0; fuel = 0; } bounce1 = true; } if (fuel < 0) { fuel = 0; } //End of Draw loop }; </script>EDIT: That doesn't seem to work on it's own, you might have to make a canvas element first.
XD
I'm asking HOW to make the canvas element.
XD
Offline
Offline
mythbusteranimator wrote:
funelephant wrote:
I'm working on something :3
No one on Scratch will be able to use itWhy?
Because I'm not giving the link because it's for school
Offline
I'm redesigning my funelephant website
Offline