Initial Android commit
This commit is contained in:
commit
1e2b80c13d
8521 changed files with 231475 additions and 0 deletions
19
scripts/backround_scenes_scripts/CarBack3d.gd
Normal file
19
scripts/backround_scenes_scripts/CarBack3d.gd
Normal file
|
@ -0,0 +1,19 @@
|
|||
extends Spatial
|
||||
|
||||
var treeInitialPos = []
|
||||
const carSpeed = 30.0
|
||||
|
||||
|
||||
func _ready():
|
||||
InitTreeStartPosition()
|
||||
|
||||
|
||||
func InitTreeStartPosition():
|
||||
for i in $TreeArray.get_child_count():
|
||||
treeInitialPos.push_back($TreeArray.get_child(i).translation.z)
|
||||
|
||||
func _process(delta):
|
||||
for i in $TreeArray.get_child_count():
|
||||
$TreeArray.get_child(i).translation.z -= carSpeed * delta
|
||||
if $TreeArray.get_child(i).translation.z <= - 1.0:
|
||||
$TreeArray.get_child(i).translation.z = treeInitialPos[i]
|
Loading…
Add table
Add a link
Reference in a new issue