Jump to content

The Mighty Goat

Members
  • Content Count

    23
  • Joined

  • Last visited

Community Reputation

0 Neutral

About The Mighty Goat

  • Rank
    Newbie

Profile Information

  • Location
    Mars
  • Interests
    Goats, JavaScript, HTML, videogames, I'm not a nerd.
  1. Thanks for helping do something pointless
  2. I am making this pointless thing where there is a blue square and the left of it moves into the right until you cant see it, and then the right side moves right to form a square again. After that, it does the same thing, but down, then left, and then back up to the starting point. I can't figure out what's wrong with my code though. So far I have until it goes left, but it doesn't finish. Try this out so you understand better. <!DOCTYPE html> <html> <head> <title>Square Matrix</title> </head> <body> <img id="BlueSquare" src="http://w
  3. I was just asking if that was how you activate a function in an if statement. I found out now though.
  4. It says for websites so I thought it only meant actual websites. I didn't see anyone there have game posts though when I quickly checked.
  5. I was thinking it would be nice for people to be easily be able to play other people's games they made (using languages such as JavaScript) without telling them to copy-paste your code. I'd like to play what other people made. As long as its it not a virus code. The only problem is, how would you do it? I have no idea.
  6. Every day, I eat 3.14159265 pies. I cut each slice very precisely.

  7. I just did the biggest face-palm ever. I did what you said and wondered why it wasn't working, so I put each part in at a time so see which was broken, and then when I added the targetArea variable, I didn't work. I looked at it and within 2 seconds, I realized it didn't have the equal sign. lol Anyway, ITS WORKING!!! Thanks so much. :) One more question: to activate a function in an if statement, would you do this? if (variable = 1) { myFunction() }
  8. ---> I found out you can only use external files if you have a website or something. I'm just writing scripts and opening them in the internet to play them. What can I do to make the JavaScript load a bit later? ---> I moved the if statement into the loop, but I still cant move the image anymore. <html> <head> <script type='text/javascript'> var image = document.getElementsByTagName("img")[0]; var targetArea = { x: 350, y: 450, width: 300, height: 300 }; // movement vars var xpos = 50; var ypos = 50; var xspeed = 1; var yspeed = 0; var maxSpeed = 5; // bou
  9. K. I've gone through the whole JavaScript part of the javascript tutorial kind-of recently so I guess I'll read the HTML DOM now.
  10. I copied the movable image code a little while ago because I didn't know how to make movable images. I mostly understand it now. I know what to change to make it how a want. The string in the loop and the 10 millisecond repeat time was part of it. I'll try what you said. Thanks I don't know how to make a file access the JavaScript in an external file but I guess I can go research that. Lastly, I still don't know what to put in the apostrophes in this part: document.getElementsByTagName("?")[0];
  11. This post was an accident I don't know how to delete posts, so ignore this.
  12. I'm using the normal Internet Explorer because chrome crashes my computer a couple times every day when I have it open. Copy paste works with everything else when I use this browser. Strange. I'll use chrome. When you remove the four groups of code you said add, the image is movable. Try it without those bits. Also, I don't know what to put in the apostrophes in this part: document.getElementsByTagName("?")[0]; <head> <script type='text/javascript'> var image = document.getElementsByTagName("img")[0]; var imageArea { x: image.offsetLeft, y: image.offsetTop, width: image.o
×
×
  • Create New...