'

With Java you would have to write a lot of code to do just one simple thing. However just by trying to solve a problem with java code is a lot more difficult when you have more than one error showing up in countless of places. Unlike C# which can be written with code in order to see what happens with an object, with Java it will be difficult if you can't see the visual result on what will happen next. In truth I would Consider java to be the most difficult, however that is only my opinion.

figure 1: Java (Scanner to recieve userInput)


Scanner sc= new Scanner(System.in);
System.out.print("Enter first number- ");
int a= sc.nextInt();

figure 2 (Greenfoot)

if(Greenfoot.isKeyDown("W"))

{

move(4);

}

Figure 3: C# With Unity (Example 1: Certain Key Down)

if(isKeyDown(getKeyCode.space) && isOnGround)
{
playerRb.AddForce(Vector3.up * 10 jumpForce, froceMode.Impulse);
isOnGround = false;
playerAnim.SetTrigger("Jump_trig");
}

Figure 4 C# with Unity (Example 2: Player Movement Controls)

public float speed = 20;
public float turnspeed = 10; public float horizontalInput;
public float ForwardInput;

void update()
{
horizontalInput = Input.getAxis("Horizontal");
forwardInput = Input.getAxis("Vertical");

transform.Translate(Vector3.forward * Time.deltatime * speed * forwardInput);
trasnform.Translate(Vector3.right * Time.deltatime * turnspeed * horizontalInput);
}

CopyRight © Justin Smith-Eitniear 2021;