Does anyone know how to code html and javascript to make games?
I just started learning code and I am having such trouble with sprite sheets, I cannot figure out how to make my sprite sheet animate, instead it just shows all of the frames at once.
Can anyone help?
Re: Coding
#2Not experienced with using HTML and JavaScript to write game coding. If your looking for something easier and more understandable I suggest you start with C++ or Objective-C. JavaScript isn't really used often nowadays and the central use for HTML is websitesDoes anyone know how to code html and javascript to make games?
I just started learning code and I am having such trouble with sprite sheets, I cannot figure out how to make my sprite sheet animate, instead it just shows all of the frames at once.
Can anyone help?
Wafflez.
(|%}^=
(|%}^=
Re: Coding
#3I would suggest taking some courses in computer science and such.Not experienced with using HTML and JavaScript to write game coding. If your looking for something easier and more understandable I suggest you start with C++ or Objective-C. JavaScript isn't really used often nowadays and the central use for HTML is websitesDoes anyone know how to code html and javascript to make games?
I just started learning code and I am having such trouble with sprite sheets, I cannot figure out how to make my sprite sheet animate, instead it just shows all of the frames at once.
Can anyone help?
”You got to do the right thing, even if it’s not what you want”
xAndrey, Level 215 Mage, Epona
Zelion, Level 180 Rogue, Epona
Member of Celtic Heroes Community since 2012
xAndrey, Level 215 Mage, Epona
Zelion, Level 180 Rogue, Epona
Member of Celtic Heroes Community since 2012
Re: Coding
#4Heh? I code for a hobby and side job and I've been doing it for 5years or soI would suggest taking some courses in computer science and such.Not experienced with using HTML and JavaScript to write game coding. If your looking for something easier and more understandable I suggest you start with C++ or Objective-C. JavaScript isn't really used often nowadays and the central use for HTML is websitesDoes anyone know how to code html and javascript to make games?
I just started learning code and I am having such trouble with sprite sheets, I cannot figure out how to make my sprite sheet animate, instead it just shows all of the frames at once.
Can anyone help?
Wafflez.
(|%}^=
(|%}^=
Re: Coding
#5you can do a lot more with javascript... rather than just html, html is the structure of webpages. JavaScript gives it functionality, I just can't figure out how to animate the freaking spritesheet. ughhhhHeh? I code for a hobby and side job and I've been doing it for 5years or soI would suggest taking some courses in computer science and such.Not experienced with using HTML and JavaScript to write game coding. If your looking for something easier and more understandable I suggest you start with C++ or Objective-C. JavaScript isn't really used often nowadays and the central use for HTML is websites
Re: Coding
#6I know unity JavaScript/unityscript (Unity GameEngine)
HTML is for coding sites
Most others are for software
There's also HTML5 (that's the name?) newer version which I think can make little games
JavaScript is more site functionalities idk about games tbh
C, C++, C# is what you learn if you want a career in game dev (I still haven't done that)
There's also Python which is very simple and can make small games
There's Ruby (Idk what it is tho lol)
The one for IOS games is umm forgot the name *searches it up* Objective-C and C oh ok I was thinking Xcode but that's a platform for developing the games huh.
What else hmmm, oh for servers I think it's SQL I don't know jack about that.
Yeah that's all I know.
But for games don't go HTML or JS.
ALERT: If I were you I'd start with any of the C languages cause I find them hard to pick up after learning Unity JS, the class system confuses me.
HTML is for coding sites
Most others are for software
There's also HTML5 (that's the name?) newer version which I think can make little games
JavaScript is more site functionalities idk about games tbh
C, C++, C# is what you learn if you want a career in game dev (I still haven't done that)
There's also Python which is very simple and can make small games
There's Ruby (Idk what it is tho lol)
The one for IOS games is umm forgot the name *searches it up* Objective-C and C oh ok I was thinking Xcode but that's a platform for developing the games huh.
What else hmmm, oh for servers I think it's SQL I don't know jack about that.
Yeah that's all I know.
But for games don't go HTML or JS.
ALERT: If I were you I'd start with any of the C languages cause I find them hard to pick up after learning Unity JS, the class system confuses me.
Re: Coding
#7Java is great -- you can embed the webplayer into a website; many online games are made this way.
World Taranis
- Regenleif -
Rachmaninoff
Aedin Flameborn
Former Leader in theILLUMINATI, Aeon, and Taranis United
I am a Guide! If you need any tips/help/advice, Click Here to send me a message!
- Regenleif -
Rachmaninoff
Aedin Flameborn
Former Leader in theILLUMINATI, Aeon, and Taranis United
I am a Guide! If you need any tips/help/advice, Click Here to send me a message!
Re: Coding
#8I am an expert in Javascript
To animate a sprite you need an element, CSS to set it to the size of one entity of the sprite, and you need to the change the css background position x
This is very basic stuff. I have built game engines with 3d model loading, physics, collision detection, ray casting, etc. all in pure vanilla javascript. I have even ported C++ physic libraries to JS and loaded them with ASM JS. That being said, If your goal is to develop games and you are already not a master in JavaScript, I recommend you focus your efforts on learning unity.
The learning curve on web development is not as steep as unity or some of the other options people are suggesting, however it is even more steep to build complex games in JS code than to build them in something like unity. Unity has html5 modules so you can run the game in a browser. You can also do the scripting in JS code. However if you really want to animate a sprite in JS code here you go:
HTML:
CSS:
JS:
Here is a codepen: https://codepen.io/mattgardner/pen/prQxbe
To animate a sprite you need an element, CSS to set it to the size of one entity of the sprite, and you need to the change the css background position x
This is very basic stuff. I have built game engines with 3d model loading, physics, collision detection, ray casting, etc. all in pure vanilla javascript. I have even ported C++ physic libraries to JS and loaded them with ASM JS. That being said, If your goal is to develop games and you are already not a master in JavaScript, I recommend you focus your efforts on learning unity.
The learning curve on web development is not as steep as unity or some of the other options people are suggesting, however it is even more steep to build complex games in JS code than to build them in something like unity. Unity has html5 modules so you can run the game in a browser. You can also do the scripting in JS code. However if you really want to animate a sprite in JS code here you go:
HTML:
Code: Select all
<doctype html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
</head>
<body>
<div class="animate"></div>
</body>
</html>
Code: Select all
.animate {
background-image: url('https://s3.envato.com/files/206414112/2D%20Game%20Character%20Sprites%20%20(2).jpg');
width: 70px;
height: 130px;
background-position-x: 905px;
background-position-y: 295px;
}
Code: Select all
var speed = 100;
var positions = [1428, 1319, 1210, 1102, 996, 905];
var index = 0;
setInterval(function(){
if (index > (positions.length - 1)) {
index = 0;
}
$('.animate').css('background-position-x', positions[index] + 'px');
index++;
}, speed);
215+ Druid
220+ Mage
220+ Warrior
220+ Rogue
215+ Ranger
220+ Mage
220+ Warrior
220+ Rogue
215+ Ranger