Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
Battle Pong
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Frederic Aust
Battle Pong
Commits
47117310
Commit
47117310
authored
4 years ago
by
Frederic Aust
Browse files
Options
Downloads
Patches
Plain Diff
Ball Speed Settings aus dem SettingsWindow an die Variablen in Ball angeschlossen
parent
e48c60d7
No related branches found
No related tags found
1 merge request
!6
Binding all settings to game
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Battle Pong/Ball.gd
+5
-1
5 additions, 1 deletion
Battle Pong/Ball.gd
with
5 additions
and
1 deletion
Battle Pong/Ball.gd
+
5
−
1
View file @
47117310
...
...
@@ -5,6 +5,7 @@ extends KinematicBody2D
export
var
speed
=
300
export
var
speed_max
=
600
export
var
bounce_degree_max
=
60
export
var
speed_increment
=
20
var
ball_size
var
playing
=
false
var
velocity
=
Vector2
(
100
,
0
)
...
...
@@ -15,6 +16,9 @@ var y_range = 100
# Called when the node enters the scene tree for the first time.
func
_ready
():
set_sync_to_physics
(
false
)
speed
=
$
"/root/GameSettings"
.
ball_speed_min
speed_max
=
$
"/root/GameSettings"
.
ball_speed_max
speed_increment
=
$
"/root/GameSettings"
.
ball_speed_increment
pass
...
...
@@ -46,7 +50,7 @@ func run(delta):
func
ball_hit_paddle
(
player_position
,
player_shape
,
is_player_one
):
# Geschwindigkeitserhöhung
if
speed
<
speed_max
:
speed
+=
20
speed
+=
speed_increment
# Ball geht in die andere Richtung
velocity
.
x
*=-
1
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment