User:Cabra/Sandbox: Difference between revisions

From TestWiki
Content added Content deleted
No edit summary
No edit summary
Line 33: Line 33:


<syntaxhighlight lang="gdscript" line="3">
<syntaxhighlight lang="gdscript" line="3">
extends Area2D

const MAX_SPEED = 250
const MAX_SPEED = 250


func _progress(_delta):
func _process(_delta):
var speed = Vector2.ZERO
if Input.in_pressed_input(move_right):
if Input.is_action_pressed("move_right"):
pass
speed.x += 1
else:
else:
speed.x -= 1
pass
## I don't know, test
## I don't know, test
var speed = MAX_SPEED
if speed.length() > 0:
speed = speed.normalized() * MAX_SPEED
position += speed * _delta
</syntaxhighlight>
</syntaxhighlight>



Revision as of 05:40, 4 October 2021

This 1 2 3 4 6 7.
EEEEEh

This is my sandbox.[1] And it will be actively updated.[1][verification needed]

First header

First one.

Code example

#include <iostream>

int main()
{
	int x{0};
	while (x != 8)
	{
		std::cout << "Ehh\n";
		x += 1;
		std::cout << "x = " << x << '\n';
	}
	return 0;
}

Why is this thing even here? lol
Not likely to use it outside this sandbox, though. Don't see how.

extends Area2D

const MAX_SPEED = 250

func _process(_delta):
	var speed = Vector2.ZERO
	if Input.is_action_pressed("move_right"):
		speed.x += 1
	else:
		speed.x -= 1
	## I don't know, test
	if speed.length() > 0:
		speed = speed.normalized() * MAX_SPEED
	position += speed * _delta

Trird header

Third one.

First lesser header

Fourth one.

Fourth header

Fifth one.

References

  1. 1.0 1.1 Me