Celtic Heroes

The Official Forum for Celtic Heroes, the 3D MMORPG for iOS and Android Devices

Coding

#1
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?
It is within you to succeed
My character Souleste was named after myself -
Image

- my middle name is Celeste, so Souleste seems fitting...
Ice all on me

Re: Coding

#2
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?
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
Wafflez.
(|%}^=

Re: Coding

#3
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?
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
I would suggest taking some courses in computer science and such.
”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

Re: Coding

#4
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?
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
I would suggest taking some courses in computer science and such.
Heh? I code for a hobby and side job and I've been doing it for 5years or so
Wafflez.
(|%}^=

Re: Coding

#5
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
I would suggest taking some courses in computer science and such.
Heh? I code for a hobby and side job and I've been doing it for 5years or so
you 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. ughhhh
It is within you to succeed
My character Souleste was named after myself -
Image

- my middle name is Celeste, so Souleste seems fitting...
Ice all on me

Re: Coding

#6
I 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.

Re: Coding

#8
I 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:

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>
CSS:

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; }
JS:

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);
Here is a codepen: https://codepen.io/mattgardner/pen/prQxbe
215+ Druid
220+ Mage
220+ Warrior
220+ Rogue
215+ Ranger

Who is online

Users browsing this forum: No registered users and 17 guests