JavaScrit (EN)

  • Comparing Java with JavaScript

    Java and JavaScript ComparingAs opposed to Java, JavaScript is relatively easy to learn. One reason for this is the need of explicit type definitions for variables, parameters and return values in Java, which are not needed in JavaScript.

    Both Java and JavaScript are “object-oriented” programming languages, but JavaScript is even more “object-oriented” than Java, which is rather “class-oriented”. There is no explicit class concept in JavaScript. Classes have to be defined in the form of special objects. However, objects can also be created without instantiating a class, and properties as well as methods can be defined for specific objects independently of any class definition.

  • JavaScript & HTML5: Introduction to 2D Game Physics Engine Development

    2D Game Physics Engine Development using JavaScript & HTML5Physics engines play an important part in many types of games. A believable physics interaction between game objects has become a key element of most modern PC and console games as well as, more recently, browser and smartphone games. The range of topics within physics for games is broad and includes, but is not limited to, areas such as rigid body, fluid dynamics, soft-body, vehicle physics, and particle physics. This article will cover the fundamental topics needed for you to get started in understanding and building a general purpose, rigid body physics engine in two dimensions. The blog also aims to provide you with a reusable game physics engine, which can be used for your own games, by guiding you through the process of building a physics engine step-by-step from scratch. This way you will gain a foundational understanding of the concepts and components required for a typical 2D rigid body system.

  • JavaScript & HTML5: Implementing the 2D Physics Engine Core

    Implementing the 2D Physics Engine Core using JavaScript & HTML5In the previous article, you implemented functionality to support basic drawing operations. Drawing is the first step to constructing your physics engine because it allows you to observe the output while continuing to expand the engine’s capabilities. In this article, two critical components for 2D physics simulations, the core engine loop and rigid shape class, will be examined and added to the engine. The core engine loop, or the engine loop, allows the engine to control and handle the real-time interaction of game objects, while the rigid shape class abstracts and hides the detailed information such as positions and rotation angles that are required for future physics calculations.

  • JavaScript for game designer: Getting Loopy with Arrays

    One of the things you do most often as a game designer is loop through arrays. Does the following code look familiar?

    let planets = ["jupiter", "venus", "saturn", "mars"];
    for (let i = 0; i < planets.length; i++) {
      planet = planets[i];
  • JavaScript for game designer: Using forEach

    ES5 introduced an array function called forEach that specializes in looping through arrays. It makes the use of a loop index counter optional. It also invokes a callback function to do its work. (You’ll see how callback functions work ahead.) That means you can reuse the same code to transform other arrays if you need to. Here’s how to use forEach to display the names of four planets:

    let planets = ["jupiter", "venus", "saturn", "mars"];
    function displayElements(element) {
  • Why is JavaScript a Good Choice for Building Web Apps?

    Today, JavaScript is not just a programming language, but rather a platform, which offers many advantages over other platforms: