1. Home
  2. /
  3. Unity
  4. /
  5. Player Movement 2D

Player Movement 2D - Unity Typing CST Test

Loading…

Player Movement 2D — Unity Code

Implements simple player movement using arrow keys in a Unity 2D scene.

// C# script: PlayerMovement.cs
using UnityEngine;

public class PlayerMovement : MonoBehaviour {
	public float speed = 5f;

	void Update() {
		float moveX = Input.GetAxis("Horizontal") * speed * Time.deltaTime;
		float moveY = Input.GetAxis("Vertical") * speed * Time.deltaTime;
		transform.Translate(moveX, moveY, 0);
	}
}

Unity Language Guide

Unity is a powerful cross-platform game engine used to build 2D, 3D, AR, VR, and real-time simulations for mobile, desktop, web, and consoles. It provides a full editor, rendering engine, physics, animation system, scripting with C#, asset pipeline, and deployment tooling.

Primary Use Cases

  • ▸2D & 3D game development
  • ▸AR/VR immersive applications
  • ▸Real-time simulators and digital twins
  • ▸Mobile and indie games
  • ▸Enterprise training & visualization tools

Notable Features

  • ▸Scene editor with drag-and-drop tools
  • ▸C# scripting and component system
  • ▸Cross-platform deployment
  • ▸Physics engines (3D/2D)
  • ▸Animation, timeline, and VFX graph

Origin & Creator

Unity was created by David Helgason, Joachim Ante, and Nicholas Francis, launched in 2005 to democratize game development with a more accessible and visual engine.

Industrial Note

Unity dominates indie game development and real-time 3D industries, extensively used in gaming, AR/VR training, simulations, architecture visualization, automotive, robotics, and digital twins.

More Unity Typing Exercises

Unity Simple 2D Todo Game PrototypeUnity Simple Click CounterUnity Object SpawnerUnity Collectible Item SystemUnity Simple TimerUnity Follow CameraUnity Basic Jump ControllerUnity Simple Enemy AIUnity Scene Switcher

Practice Other Languages

CReactPythonC++RustTypeScriptKotlinPHPJavaC#RubyMqlCqlN1qlCypher