<스크립트>
*player.gd
extends KinematicBody2D
func _physics_process(delta):
if Input.is_action_pressed("ui_right"):
$Sprite.flip_h = false
$Sprite.play("Run")
motion.x = lerp(motion.x, 0, 0.2)
motion = move_and_slide(motion, UP)
*WorldComplete.gd
extends Area2D
export(String, FILE, ".tscn") var next_world
func _physics_process(delta):
var bodies = get_overlapping_bodies()
for body in bodies:
if body.name == "player2":
get_tree().change_scene(next_world)
*************************************************************************************************
<P1, P2: Player>
KinematicBody2D
Sprite
CollisionShape2D
KinematicBody2D
AnimatedSprite
CollisionShape2D
>>Frames - New SpriteFrames 클릭
Sprite Frames 탭에서 애니메이션 설정
Import - Preset - 2D Pixel 선택 후 Reimport 할 것.
<P2 : 타일맵>
Node
Sprite
>>Offset-Centerd : off
>>Region-Enavled : on
>>Texture Region 탭
Snap Mode : Grid Snap
Sprite를 배치 후에, Scene - Convert To - TileSet : tres 파일로 저장
씬에 TileMap 배치 Tile Set에 tres 파일 지정
<P4 : 레벨 이동>
Area2D
Sprite
CollisionShape2D
*************************************************************************************************
<P6: ParallaxBackground>
www.youtube.com/watch?v=K-eM2ZLI1q8&list=PL9FzW-m48fn2jlBu_0DRh7PvAt-GULEmd&index=6
Project Settings
Rendering - Quality - 2d :: Use Pixel Snap (On)
Camera - Smoothing (Off)
ParallaxBackground
ParallaxLayer
Motion - Mirroring (640, 640)
Motion - Scale (0.1, 0.1)
Sprite
Offset Centerd(off) Offset (0,0)
*************************************************************************************************
<P7 : UI, Signals>
www.youtube.com/watch?v=sBuJRHvk5sY&list=PL9FzW-m48fn2jlBu_0DRh7PvAt-GULEmd&index=7
*UI
Control
CenterContainer
VboxContainer
Label
Button
MarginContainer
CenterContainer
VButtonArray
get_tree().change_scene("")
get_tree().quit()
'개발 > 고도 엔진.Godot engine' 카테고리의 다른 글
GODOT3 튜토리얼 : Make an Action RPG in Godot 3.2 (0) | 2021.05.21 |
---|---|
Godot 3.2 Autotile bitmask (0) | 2020.10.01 |
GODOT3 튜토리얼 : Scriptable Objects (0) | 2020.09.07 |
modules/mono/glue/gd_glue.cpp:250 - Cannot find dotnet CLI executable. Fallback to MSBuild from Visual Studio. (0) | 2020.08.16 |
고도 메모 GODOT (0) | 2020.06.02 |