mirror of
https://github.com/godotengine/godot-demo-projects.git
synced 2025-12-31 09:49:06 +03:00
Remove trailing space characters in the formatting script
This commit is contained in:
@@ -16,7 +16,7 @@ size_flags_vertical = 4
|
||||
custom_fonts/bold_font = ExtResource( 1 )
|
||||
custom_fonts/normal_font = ExtResource( 2 )
|
||||
bbcode_enabled = true
|
||||
bbcode_text = "This example shows how to apply the State programming pattern in GDscript, including Hierarchical States, and a pushdown automaton.
|
||||
bbcode_text = "This example shows how to apply the State programming pattern in GDscript, including Hierarchical States, and a pushdown automaton.
|
||||
|
||||
States are common in games. You can use the pattern to:
|
||||
|
||||
@@ -25,7 +25,7 @@ States are common in games. You can use the pattern to:
|
||||
3. Improve your code's structure. Look at the scene tree and FileSystem tab: without looking at the code, you'll know what the Player can or cannot do.
|
||||
|
||||
You can read more about States in the excellent [url=http://gameprogrammingpatterns.com/state.html]Game Programming Patterns ebook[/url]."
|
||||
text = "This example shows how to apply the State programming pattern in GDscript, including Hierarchical States, and a pushdown automaton.
|
||||
text = "This example shows how to apply the State programming pattern in GDscript, including Hierarchical States, and a pushdown automaton.
|
||||
|
||||
States are common in games. You can use the pattern to:
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
This demo shows a traditional isometric view with depth sorting.
|
||||
|
||||
A character can move around the level and will also slide around objects,
|
||||
as well as be occluded when standing in front or behind them.
|
||||
as well as be occluded when standing in front or behind them.
|
||||
|
||||
Language: GDScript
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ Example of using 2D navigation using a
|
||||
[`NavigationPolygon`](https://docs.godotengine.org/en/latest/classes/class_navigationpolygon.html)
|
||||
in a [`NavigationPolygonInstance`](https://docs.godotengine.org/en/latest/classes/class_navigationpolygoninstance.html) node.
|
||||
It uses the 2D navigation API to request a path between two points,
|
||||
and then traverses the resulting path.
|
||||
and then traverses the resulting path.
|
||||
|
||||
Language: GDScript
|
||||
|
||||
|
||||
@@ -13,5 +13,5 @@ func _physics_process(delta):
|
||||
var d = sin(accum)
|
||||
var xf = Transform2D()
|
||||
|
||||
xf[2]= motion * d
|
||||
xf[2]= motion * d
|
||||
($Platform as RigidBody2D).transform = xf
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
# 3D Physics Tests
|
||||
|
||||
This demo contains a series of tests for the 3D
|
||||
This demo contains a series of tests for the 3D
|
||||
physics engine.
|
||||
|
||||
They can be used for different purpose:
|
||||
- Functional tests to check for regressions and
|
||||
- Functional tests to check for regressions and
|
||||
compare the behavior between physics engines
|
||||
- Performance tests to evaluate and compare
|
||||
- Performance tests to evaluate and compare
|
||||
performance between physics engines
|
||||
|
||||
Language: GDScript
|
||||
|
||||
@@ -133,7 +133,7 @@ func _physics_process(delta):
|
||||
func adjust_facing(p_facing, p_target, p_step, p_adjust_rate, current_gn):
|
||||
var n = p_target # Normal.
|
||||
var t = n.cross(current_gn).normalized()
|
||||
|
||||
|
||||
var x = n.dot(p_facing)
|
||||
var y = t.dot(p_facing)
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur.
|
||||
Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. \
|
||||
Copyright (c) 2014-2020 Godot Engine contributors.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
|
||||
@@ -31,7 +31,7 @@ func _process(_delta):
|
||||
return
|
||||
|
||||
var time = 0.0
|
||||
if sync_source == SyncSource.SYSTEM_CLOCK:
|
||||
if sync_source == SyncSource.SYSTEM_CLOCK:
|
||||
# Obtain from ticks.
|
||||
time = (OS.get_ticks_usec() - time_begin) / 1000000.0
|
||||
# Compensate.
|
||||
|
||||
@@ -17,6 +17,8 @@ while IFS= read -rd '' f; do
|
||||
sed -i '1s/^\xEF\xBB\xBF//' "$f"
|
||||
# Ensures that files end with newline characters.
|
||||
tail -c1 < "$f" | read -r _ || echo >> "$f";
|
||||
# Remove trailing space characters.
|
||||
sed -z -i 's/\x20\x0A/\x0A/g' "$f"
|
||||
done
|
||||
|
||||
git diff > patch.patch
|
||||
|
||||
@@ -3,9 +3,9 @@ Copyright (C) 2008 The Android Open Source Project
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Loading with Threads
|
||||
|
||||
An example using a thread to load an image.
|
||||
An example using a thread to load an image.
|
||||
|
||||
Language: GDScript
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ rect_min_size = Vector2( 500, 50 )
|
||||
text = "
|
||||
Controls: WASD to move, Space to jump, R to reset, Shift to walk, T to toggle isometric controls, C to view cube demo, Tab to toggle hints.
|
||||
|
||||
UIOJKL to change view mode. U = Forty Five deg, I = Isometric,
|
||||
UIOJKL to change view mode. U = Forty Five deg, I = Isometric,
|
||||
O = Top Down, J = Front Side, K = Oblique Y, L = Oblique Z
|
||||
|
||||
Not every view mode is meant to be good, it's just to showcase what the system can do.
|
||||
|
||||
@@ -18,7 +18,7 @@ rect_min_size = Vector2( 500, 50 )
|
||||
text = "
|
||||
Controls: WASDQE to rotate, R to reset, C to return to the world, Tab to toggle hints.
|
||||
|
||||
UIOKL to change view mode. U = Forty Five deg, I = Isometric,
|
||||
UIOKL to change view mode. U = Forty Five deg, I = Isometric,
|
||||
O = Top Down, K = Oblique Y, L = Oblique Z
|
||||
|
||||
Not every view mode is meant to be good, it's just to showcase what the system can do.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Instancing Demo
|
||||
|
||||
A demo showing how to use scene instancing to
|
||||
make many duplicates of the same object.
|
||||
make many duplicates of the same object.
|
||||
|
||||
Language: GDScript
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Joypads Demo
|
||||
|
||||
A tool for testing joypad input.
|
||||
A tool for testing joypad input.
|
||||
|
||||
Language: GDScript
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# RegEx (Regular Expressions)
|
||||
|
||||
A demo showing regex functionality and usage.
|
||||
Can also serve as a playground for regex testing.
|
||||
Can also serve as a playground for regex testing.
|
||||
|
||||
Language: GDScript
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
extends Node
|
||||
|
||||
# Below are a number of helper functions that show how you can use the raw sensor data to determine the orientation
|
||||
# Below are a number of helper functions that show how you can use the raw sensor data to determine the orientation
|
||||
# of your phone/device. The cheapest phones only have an accelerometer only the most expensive phones have all three.
|
||||
# Note that none of this logic filters data. Filters introduce lag but also provide stability. There are plenty
|
||||
# of examples on the internet on how to implement these. I wanted to keep this straight forward.
|
||||
|
||||
# We draw a few arrow objects to visualize the vectors and two cubes to show two implementation for orientating
|
||||
# We draw a few arrow objects to visualize the vectors and two cubes to show two implementation for orientating
|
||||
# these cubes to our phones orientation.
|
||||
# This is a 3D example however reading the phones orientation is also invaluable for 2D
|
||||
|
||||
@@ -73,7 +73,7 @@ func rotate_by_gyro(p_gyro, p_basis, p_delta):
|
||||
|
||||
return rotate * p_basis
|
||||
|
||||
# This function corrects the drift in our matrix by our gravity vector
|
||||
# This function corrects the drift in our matrix by our gravity vector
|
||||
func drift_correction(p_basis, p_grav):
|
||||
# as always, make sure our vector is normalized but also invert as our gravity points down
|
||||
var real_up = -p_grav.normalized()
|
||||
@@ -110,7 +110,7 @@ func _process(delta):
|
||||
else:
|
||||
# The gravity vector is calculated by the OS by combining the other sensor inputs.
|
||||
# If we don't have a gravity vector, from now on, use accelerometer...
|
||||
grav = acc
|
||||
grav = acc
|
||||
|
||||
if mag.length() < 0.1:
|
||||
mag = Vector3(1.0, 0.0, 0.0)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Tween Interpolation
|
||||
|
||||
A demo showing advanced tween usage.
|
||||
A demo showing advanced tween usage.
|
||||
|
||||
Language: GDScript
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ A demo showing the various window management features available through
|
||||
- Minimizing and maximizing.
|
||||
- Moving the window around.
|
||||
- Capturing or hiding the mouse.
|
||||
- Getting various information about the screens, including DPI.
|
||||
- Getting various information about the screens, including DPI.
|
||||
|
||||
Language: GDScript
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ public class Node25D : Node2D, IComparable<Node25D>
|
||||
{
|
||||
spatialNode = GetChild<Spatial>(0);
|
||||
}
|
||||
|
||||
|
||||
GlobalPosition = transform25D.FlatPosition;
|
||||
}
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ public class Viewport25D : Control
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// View mode polling.
|
||||
var viewModeChangedThisFrame = false;
|
||||
var newViewMode = viewModeButtonGroup.GetPressedButton().GetIndex();
|
||||
@@ -69,7 +69,7 @@ public class Viewport25D : Control
|
||||
viewModeChangedThisFrame = true;
|
||||
RecursiveChangeViewMode(GetTree().EditedSceneRoot);
|
||||
}
|
||||
|
||||
|
||||
// Zooming.
|
||||
if (Input.IsMouseButtonPressed((int)ButtonList.WheelUp))
|
||||
{
|
||||
@@ -80,11 +80,11 @@ public class Viewport25D : Control
|
||||
zoomLevel -= 1;
|
||||
}
|
||||
float zoom = GetZoomAmount();
|
||||
|
||||
|
||||
// Viewport size.
|
||||
Vector2 size = GetGlobalRect().Size;
|
||||
viewport2d.Size = size;
|
||||
|
||||
|
||||
// Viewport transform.
|
||||
Transform2D viewportTrans = Transform2D.Identity;
|
||||
viewportTrans.x *= zoom;
|
||||
@@ -92,7 +92,7 @@ public class Viewport25D : Control
|
||||
viewportTrans.origin = viewportTrans.BasisXform(viewportCenter) + size / 2;
|
||||
viewport2d.CanvasTransform = viewportTrans;
|
||||
viewportOverlay.CanvasTransform = viewportTrans;
|
||||
|
||||
|
||||
// Delete unused gizmos.
|
||||
var selection = editorInterface.GetSelection().GetSelectedNodes();
|
||||
var overlayChildren = viewportOverlay.GetChildren();
|
||||
|
||||
@@ -18,7 +18,7 @@ rect_min_size = Vector2( 500, 50 )
|
||||
text = "
|
||||
Controls: WASD to move, Space to jump, R to reset, Shift to walk, T to toggle isometric controls, C to view cube demo, Tab to toggle hints.
|
||||
|
||||
UIOJKL to change view mode. U = Forty Five deg, I = Isometric,
|
||||
UIOJKL to change view mode. U = Forty Five deg, I = Isometric,
|
||||
O = Top Down, J = Front Side, K = Oblique Y, L = Oblique Z
|
||||
|
||||
Not every view mode is meant to be good, it's just to showcase what the system can do.
|
||||
|
||||
@@ -18,7 +18,7 @@ rect_min_size = Vector2( 500, 50 )
|
||||
text = "
|
||||
Controls: WASDQE to rotate, R to reset, C to return to the world, Tab to toggle hints.
|
||||
|
||||
UIOKL to change view mode. U = Forty Five deg, I = Isometric,
|
||||
UIOKL to change view mode. U = Forty Five deg, I = Isometric,
|
||||
O = Top Down, K = Oblique Y, L = Oblique Z
|
||||
|
||||
Not every view mode is meant to be good, it's just to showcase what the system can do.
|
||||
|
||||
@@ -84,7 +84,7 @@ public class Main : Node
|
||||
|
||||
// Choose the velocity.
|
||||
mobInstance.SetLinearVelocity(new Vector2(RandRange(150f, 250f), 0).Rotated(direction));
|
||||
|
||||
|
||||
GetNode("HUD").Connect("StartGame", mobInstance, "OnStartGame");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ public class Mob : RigidBody2D
|
||||
{
|
||||
QueueFree();
|
||||
}
|
||||
|
||||
|
||||
public void OnStartGame()
|
||||
{
|
||||
QueueFree();
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
A multiplayer implementation of the classical bomberman game.
|
||||
One of the players should press "host", while the other
|
||||
should type in his address and press "play".
|
||||
should type in his address and press "play".
|
||||
|
||||
Language: GDScript
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
A multiplayer demo of the classical pong game.
|
||||
One of the players should press "host", while the
|
||||
other should select the address and press "join".
|
||||
other should select the address and press "join".
|
||||
|
||||
Language: GDScript
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ func _process(delta):
|
||||
# even if it's sightly out of sync between them,
|
||||
# so each player sees the motion as smooth and not jerky.
|
||||
if not stopped:
|
||||
translate(_speed * delta * direction)
|
||||
translate(_speed * delta * direction)
|
||||
|
||||
# Check screen bounds to make ball bounce.
|
||||
var ball_pos = position
|
||||
|
||||
@@ -18,7 +18,7 @@ func _ready():
|
||||
# while all nodes in clients inherit from puppet.
|
||||
# set_network_master is tree-recursive by default.
|
||||
if get_tree().is_network_server():
|
||||
# For the server, give control of player 2 to the other peer.
|
||||
# For the server, give control of player 2 to the other peer.
|
||||
player2.set_network_master(get_tree().get_network_connected_peers()[0])
|
||||
else:
|
||||
# For the client, give control of player 2 to itself.
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
"implicit-arrow-linebreak": "error",
|
||||
"indent": [
|
||||
"error",
|
||||
"tab"
|
||||
"tab"
|
||||
],
|
||||
"indent-legacy": "off",
|
||||
"init-declarations": "error",
|
||||
|
||||
@@ -11,7 +11,7 @@ Renderer: GLES 2
|
||||
The Pong game is rendered to a custom
|
||||
[`Viewport`](https://docs.godotengine.org/en/latest/classes/class_viewport.html)
|
||||
node rather than the main Viewport. In the code,
|
||||
`get_texture()` is called on the Viewport to get a
|
||||
`get_texture()` is called on the Viewport to get a
|
||||
[`ViewportTexture`](https://docs.godotengine.org/en/latest/classes/class_viewporttexture.html),
|
||||
which is then assigned to the quad's material's albedo texture.
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ Renderer: GLES 2
|
||||
The 3D robot is rendered to a custom
|
||||
[`Viewport`](https://docs.godotengine.org/en/latest/classes/class_viewport.html)
|
||||
node rather than the main Viewport. In the code,
|
||||
`get_texture()` is called on the Viewport to get a
|
||||
`get_texture()` is called on the Viewport to get a
|
||||
[`ViewportTexture`](https://docs.godotengine.org/en/latest/classes/class_viewporttexture.html),
|
||||
which is then assigned to the sprite's texture.
|
||||
|
||||
|
||||
@@ -2,20 +2,20 @@ extends Spatial
|
||||
|
||||
# Handle the motion of both players' camera as well as communication with the
|
||||
# SplitScreen shader to achieve the dynamic split screen effet
|
||||
#
|
||||
# Cameras are place on the segment joining the two players, either in the middle
|
||||
#
|
||||
# Cameras are place on the segment joining the two players, either in the middle
|
||||
# if players are close enough or at a fixed distance if they are not.
|
||||
# In the first case, both cameras being at the same location, only the view of
|
||||
# the first one is used for the entire screen thus allowing the players to play
|
||||
# In the first case, both cameras being at the same location, only the view of
|
||||
# the first one is used for the entire screen thus allowing the players to play
|
||||
# on a unsplit screen.
|
||||
# In the second case, the screen is split in two with a line perpendicular to the
|
||||
# segement joining the two players.
|
||||
#
|
||||
#
|
||||
# The points of customization are:
|
||||
# max_separation: the distance between players at which the view starts to split
|
||||
# split_line_thickness: the thickness of the split line in pixels
|
||||
# split_line_color: color of the split line
|
||||
# adaptive_split_line_thickness: if true, the split line thickness will vary
|
||||
# adaptive_split_line_thickness: if true, the split line thickness will vary
|
||||
# depending on the distance between players. If false, the thickness will
|
||||
# be constant and equal to split_line_thickness
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ achieve the effect.
|
||||
|
||||
The cameras are placed on the segment joining the two players,
|
||||
either in the middle if they're close enough or at a fixed
|
||||
distance otherwise.
|
||||
distance otherwise.
|
||||
|
||||
## How to use it
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Screen Capture
|
||||
|
||||
An example showing how to take screenshots of the screen.
|
||||
An example showing how to take screenshots of the screen.
|
||||
|
||||
Language: GDScript
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
Demo of a simple game using visual script.
|
||||
You must click the circles to "pop" them in
|
||||
order to stop their invasion of the screen.
|
||||
order to stop their invasion of the screen.
|
||||
|
||||
Language: [VisualScript](https://docs.godotengine.org/en/latest/getting_started/scripting/visual_script/index.html)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user