File tree Expand file tree Collapse file tree 12 files changed +20
-32
lines changed
networking/webrtc_minimal Expand file tree Collapse file tree 12 files changed +20
-32
lines changed Original file line number Diff line number Diff line change @@ -44,8 +44,8 @@ func _on_MobTimer_timeout():
4444 direction += rand_range (- PI / 4 , PI / 4 )
4545 mob .rotation = direction
4646
47- # Choose the velocity.
48- var velocity = Vector2 (rand_range (mob . min_speed , mob . max_speed ), 0 )
47+ # Choose the velocity for the mob .
48+ var velocity = Vector2 (rand_range (150.0 , 250.0 ), 0. 0 )
4949 mob .linear_velocity = velocity .rotated (direction )
5050
5151
Original file line number Diff line number Diff line change 11extends RigidBody2D
22
3- # warning-ignore-all:unused_class_variable
4- export var min_speed = 150
5- export var max_speed = 250
6-
73func _ready ():
84 $ AnimatedSprite .playing = true
95 var mob_types = $ AnimatedSprite .frames .get_animation_names ()
@@ -12,7 +8,3 @@ func _ready():
128
139func _on_VisibilityNotifier2D_screen_exited ():
1410 queue_free ()
15-
16-
17- func _on_start_game ():
18- queue_free ()
Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ Renderer: GLES 3 (particles are not available in GLES 2)
1414
1515Note: There is a C# version available [ here] ( https://github.com/godotengine/godot-demo-projects/tree/master/mono/dodge_the_creeps ) .
1616
17+ Note: There is a GDNative C++ version available [ here] ( https://github.com/godotengine/gdnative-demos/tree/master/cpp/dodge_the_creeps ) .
18+
1719Check out this demo on the asset library: https://godotengine.org/asset-library/asset/515
1820
1921## Screenshots
Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ Note: There is a C# version available [here](https://github.com/godotengine/godo
1212
1313Note: There is a VisualScript version available [ here] ( https://github.com/godotengine/godot-demo-projects/tree/master/visual_script/pong ) .
1414
15+ Note: There is a GDNative C++ version available [ here] ( https://github.com/godotengine/gdnative-demos/tree/master/cpp/pong ) .
16+
1517Check out this demo on the asset library: https://godotengine.org/asset-library/asset/121
1618
1719## How does it work?
Original file line number Diff line number Diff line change @@ -2,10 +2,10 @@ extends Area2D
22
33const DEFAULT_SPEED = 100
44
5+ var _speed = DEFAULT_SPEED
56var direction = Vector2 .LEFT
67
78onready var _initial_pos = position
8- onready var _speed = DEFAULT_SPEED
99
1010func _process (delta ):
1111 _speed += delta * 2
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ var _loaded = false
1212func _enter_tree ():
1313 if Settings ._loaded :
1414 printerr ("Error: Settings is an AutoLoad singleton and it shouldn't be instanced elsewhere." )
15- printerr ("Please delete the instance at: " + get_path ())
15+ printerr ("Please delete the instance at: " + String ( get_path () ))
1616 else :
1717 Settings ._loaded = true
1818
Original file line number Diff line number Diff line change @@ -83,8 +83,8 @@ public void OnMobTimerTimeout()
8383 direction += ( float ) GD . RandRange ( - Mathf . Pi / 4 , Mathf . Pi / 4 ) ;
8484 mob . Rotation = direction ;
8585
86- // Choose the velocity.
87- var velocity = new Vector2 ( ( float ) GD . RandRange ( mob . minSpeed , mob . maxSpeed ) , 0 ) ;
86+ // Choose the velocity for the mob .
87+ var velocity = new Vector2 ( ( float ) GD . RandRange ( 150.0 , 250.0 ) , 0 ) ;
8888 mob . LinearVelocity = velocity . Rotated ( direction ) ;
8989 }
9090}
Original file line number Diff line number Diff line change 11using Godot ;
2- using System ;
32
43public class Mob : RigidBody2D
54{
6- [ Export ]
7- public int minSpeed ;
8-
9- [ Export ]
10- public int maxSpeed ;
11-
125 public override void _Ready ( )
136 {
147 var animSprite = GetNode < AnimatedSprite > ( "AnimatedSprite" ) ;
@@ -21,9 +14,4 @@ public void OnVisibilityScreenExited()
2114 {
2215 QueueFree ( ) ;
2316 }
24-
25- public void OnStartGame ( )
26- {
27- QueueFree ( ) ;
28- }
2917}
Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ Renderer: GLES 3 (particles are not available in GLES 2)
1414
1515Note: There is a GDScript version available [ here] ( https://github.com/godotengine/godot-demo-projects/tree/master/2d/dodge_the_creeps ) .
1616
17+ Note: There is a GDNative C++ version available [ here] ( https://github.com/godotengine/gdnative-demos/tree/master/cpp/dodge_the_creeps ) .
18+
1719Check out this demo on the asset library: https://godotengine.org/asset-library/asset/534
1820
1921## Screenshots
Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ Note: There is a GDScript version available [here](https://github.com/godotengin
1212
1313Note: There is a VisualScript version available [ here] ( https://github.com/godotengine/godot-demo-projects/tree/master/visual_script/pong ) .
1414
15+ Note: There is a GDNative C++ version available [ here] ( https://github.com/godotengine/gdnative-demos/tree/master/cpp/pong ) .
16+
1517Check out this demo on the asset library: https://godotengine.org/asset-library/asset/535
1618
1719## How does it work?
You can’t perform that action at this time.
0 commit comments