@ -0,0 +1,55 @@
@@ -0,0 +1,55 @@
|
||||
extends KinematicBody2D |
||||
|
||||
|
||||
# Declare member variables here. Examples: |
||||
# var a = 2 |
||||
# var b = "text" |
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time. |
||||
var moveSpeed : int = 180 |
||||
var vel = Vector2() |
||||
var facingDir = Vector2() |
||||
onready var rayCast = $RayCast2D |
||||
onready var anim = $AnimatedSprite |
||||
|
||||
func _ready(): |
||||
pass |
||||
|
||||
func _physics_process(delta): |
||||
handle_interactions() |
||||
handle_movements() |
||||
|
||||
func handle_interactions(): |
||||
if Input.is_action_just_pressed("ui_accept"): |
||||
for body in $Area2D.get_overlapping_areas(): |
||||
if body.has_method("show_dialogue"): |
||||
body.show_dialogue() |
||||
return |
||||
|
||||
func handle_movements(): |
||||
vel = Vector2(-1, 0) |
||||
|
||||
# inputs |
||||
if Input.is_action_pressed("move_up"): |
||||
vel.y = -1 |
||||
facingDir = Vector2(-1, -1) |
||||
if Input.is_action_pressed("move_down"): |
||||
vel.y = 1 |
||||
facingDir = Vector2(-1, 1) |
||||
if Input.is_action_pressed("move_left"): |
||||
vel.x = -1 |
||||
facingDir = Vector2(-1, 0) |
||||
|
||||
# move the player |
||||
move_and_slide(vel * moveSpeed, Vector2.ZERO) |
||||
manage_animations() |
||||
|
||||
func play_animation (anim_name): |
||||
if anim.animation != anim_name: |
||||
anim.play(anim_name) |
||||
|
||||
func manage_animations (): |
||||
if vel.x < 0: |
||||
play_animation("MoveLeft") |
||||
|
@ -0,0 +1,31 @@
@@ -0,0 +1,31 @@
|
||||
[gd_scene load_steps=8 format=2] |
||||
|
||||
[ext_resource path="res://Car.gd" type="Script" id=1] |
||||
[ext_resource path="res://Sprites/alistair/car-full-1.png" type="Texture" id=2] |
||||
[ext_resource path="res://Sprites/alistair/car-full-2.png" type="Texture" id=3] |
||||
[ext_resource path="res://Sprites/alistair/car-full.png" type="Texture" id=4] |
||||
[ext_resource path="res://Sprites/alistair/car-full-3.png" type="Texture" id=5] |
||||
|
||||
[sub_resource type="SpriteFrames" id=1] |
||||
animations = [ { |
||||
"frames": [ ExtResource( 4 ), ExtResource( 2 ), ExtResource( 3 ), ExtResource( 5 ) ], |
||||
"loop": true, |
||||
"name": "default", |
||||
"speed": 5.0 |
||||
} ] |
||||
|
||||
[sub_resource type="CapsuleShape2D" id=2] |
||||
radius = 26.0 |
||||
height = 236.0 |
||||
|
||||
[node name="Car" type="KinematicBody2D"] |
||||
script = ExtResource( 1 ) |
||||
|
||||
[node name="AnimatedSprite" type="AnimatedSprite" parent="."] |
||||
position = Vector2( 0, -42 ) |
||||
frames = SubResource( 1 ) |
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."] |
||||
position = Vector2( 0, 3 ) |
||||
rotation = 1.5708 |
||||
shape = SubResource( 2 ) |
After Width: | Height: | Size: 2.8 KiB |
@ -0,0 +1,35 @@
@@ -0,0 +1,35 @@
|
||||
[remap] |
||||
|
||||
importer="texture" |
||||
type="StreamTexture" |
||||
path="res://.import/car-1.png-bdff6bdf4ff690773a4a414ee2cac7ff.stex" |
||||
metadata={ |
||||
"vram_texture": false |
||||
} |
||||
|
||||
[deps] |
||||
|
||||
source_file="res://Sprites/alistair/car-1.png" |
||||
dest_files=[ "res://.import/car-1.png-bdff6bdf4ff690773a4a414ee2cac7ff.stex" ] |
||||
|
||||
[params] |
||||
|
||||
compress/mode=0 |
||||
compress/lossy_quality=0.7 |
||||
compress/hdr_mode=0 |
||||
compress/bptc_ldr=0 |
||||
compress/normal_map=0 |
||||
flags/repeat=0 |
||||
flags/filter=true |
||||
flags/mipmaps=false |
||||
flags/anisotropic=false |
||||
flags/srgb=2 |
||||
process/fix_alpha_border=true |
||||
process/premult_alpha=false |
||||
process/HDR_as_SRGB=false |
||||
process/invert_color=false |
||||
process/normal_map_invert_y=false |
||||
stream=false |
||||
size_limit=0 |
||||
detect_3d=true |
||||
svg/scale=1.0 |
After Width: | Height: | Size: 2.7 KiB |
@ -0,0 +1,35 @@
@@ -0,0 +1,35 @@
|
||||
[remap] |
||||
|
||||
importer="texture" |
||||
type="StreamTexture" |
||||
path="res://.import/car-2.png-f14ebdd25b94d9c25824d9a37faa4cb0.stex" |
||||
metadata={ |
||||
"vram_texture": false |
||||
} |
||||
|
||||
[deps] |
||||
|
||||
source_file="res://Sprites/alistair/car-2.png" |
||||
dest_files=[ "res://.import/car-2.png-f14ebdd25b94d9c25824d9a37faa4cb0.stex" ] |
||||
|
||||
[params] |
||||
|
||||
compress/mode=0 |
||||
compress/lossy_quality=0.7 |
||||
compress/hdr_mode=0 |
||||
compress/bptc_ldr=0 |
||||
compress/normal_map=0 |
||||
flags/repeat=0 |
||||
flags/filter=true |
||||
flags/mipmaps=false |
||||
flags/anisotropic=false |
||||
flags/srgb=2 |
||||
process/fix_alpha_border=true |
||||
process/premult_alpha=false |
||||
process/HDR_as_SRGB=false |
||||
process/invert_color=false |
||||
process/normal_map_invert_y=false |
||||
stream=false |
||||
size_limit=0 |
||||
detect_3d=true |
||||
svg/scale=1.0 |
After Width: | Height: | Size: 2.8 KiB |
@ -0,0 +1,35 @@
@@ -0,0 +1,35 @@
|
||||
[remap] |
||||
|
||||
importer="texture" |
||||
type="StreamTexture" |
||||
path="res://.import/car-3.png-9481e6a0d35cc134c8d5b801cecbb9b8.stex" |
||||
metadata={ |
||||
"vram_texture": false |
||||
} |
||||
|
||||
[deps] |
||||
|
||||
source_file="res://Sprites/alistair/car-3.png" |
||||
dest_files=[ "res://.import/car-3.png-9481e6a0d35cc134c8d5b801cecbb9b8.stex" ] |
||||
|
||||
[params] |
||||
|
||||
compress/mode=0 |
||||
compress/lossy_quality=0.7 |
||||
compress/hdr_mode=0 |
||||
compress/bptc_ldr=0 |
||||
compress/normal_map=0 |
||||
flags/repeat=0 |
||||
flags/filter=true |
||||
flags/mipmaps=false |
||||
flags/anisotropic=false |
||||
flags/srgb=2 |
||||
process/fix_alpha_border=true |
||||
process/premult_alpha=false |
||||
process/HDR_as_SRGB=false |
||||
process/invert_color=false |
||||
process/normal_map_invert_y=false |
||||
stream=false |
||||
size_limit=0 |
||||
detect_3d=true |
||||
svg/scale=1.0 |
After Width: | Height: | Size: 3.9 KiB |
@ -0,0 +1,35 @@
@@ -0,0 +1,35 @@
|
||||
[remap] |
||||
|
||||
importer="texture" |
||||
type="StreamTexture" |
||||
path="res://.import/car-full-1.png-cabcdf79796cb99f9547cd171458def1.stex" |
||||
metadata={ |
||||
"vram_texture": false |
||||
} |
||||
|
||||
[deps] |
||||
|
||||
source_file="res://Sprites/alistair/car-full-1.png" |
||||
dest_files=[ "res://.import/car-full-1.png-cabcdf79796cb99f9547cd171458def1.stex" ] |
||||
|
||||
[params] |
||||
|
||||
compress/mode=0 |
||||
compress/lossy_quality=0.7 |
||||
compress/hdr_mode=0 |
||||
compress/bptc_ldr=0 |
||||
compress/normal_map=0 |
||||
flags/repeat=0 |
||||
flags/filter=true |
||||
flags/mipmaps=false |
||||
flags/anisotropic=false |
||||
flags/srgb=2 |
||||
process/fix_alpha_border=true |
||||
process/premult_alpha=false |
||||
process/HDR_as_SRGB=false |
||||
process/invert_color=false |
||||
process/normal_map_invert_y=false |
||||
stream=false |
||||
size_limit=0 |
||||
detect_3d=true |
||||
svg/scale=1.0 |
After Width: | Height: | Size: 3.9 KiB |
@ -0,0 +1,35 @@
@@ -0,0 +1,35 @@
|
||||
[remap] |
||||
|
||||
importer="texture" |
||||
type="StreamTexture" |
||||
path="res://.import/car-full-2.png-31f338b49f9a83f45b974953c3daa168.stex" |
||||
metadata={ |
||||
"vram_texture": false |
||||
} |
||||
|
||||
[deps] |
||||
|
||||
source_file="res://Sprites/alistair/car-full-2.png" |
||||
dest_files=[ "res://.import/car-full-2.png-31f338b49f9a83f45b974953c3daa168.stex" ] |
||||
|
||||
[params] |
||||
|
||||
compress/mode=0 |
||||
compress/lossy_quality=0.7 |
||||
compress/hdr_mode=0 |
||||
compress/bptc_ldr=0 |
||||
compress/normal_map=0 |
||||
flags/repeat=0 |
||||
flags/filter=true |
||||
flags/mipmaps=false |
||||
flags/anisotropic=false |
||||
flags/srgb=2 |
||||
process/fix_alpha_border=true |
||||
process/premult_alpha=false |
||||
process/HDR_as_SRGB=false |
||||
process/invert_color=false |
||||
process/normal_map_invert_y=false |
||||
stream=false |
||||
size_limit=0 |
||||
detect_3d=true |
||||
svg/scale=1.0 |
After Width: | Height: | Size: 3.9 KiB |
@ -0,0 +1,35 @@
@@ -0,0 +1,35 @@
|
||||
[remap] |
||||
|
||||
importer="texture" |
||||
type="StreamTexture" |
||||
path="res://.import/car-full-3.png-aacd25ee16102299047a8b4febbcfdb4.stex" |
||||
metadata={ |
||||
"vram_texture": false |
||||
} |
||||
|
||||
[deps] |
||||
|
||||
source_file="res://Sprites/alistair/car-full-3.png" |
||||
dest_files=[ "res://.import/car-full-3.png-aacd25ee16102299047a8b4febbcfdb4.stex" ] |
||||
|
||||
[params] |
||||
|
||||
compress/mode=0 |
||||
compress/lossy_quality=0.7 |
||||
compress/hdr_mode=0 |
||||
compress/bptc_ldr=0 |
||||
compress/normal_map=0 |
||||
flags/repeat=0 |
||||
flags/filter=true |
||||
flags/mipmaps=false |
||||
flags/anisotropic=false |
||||
flags/srgb=2 |
||||
process/fix_alpha_border=true |
||||
process/premult_alpha=false |
||||
process/HDR_as_SRGB=false |
||||
process/invert_color=false |
||||
process/normal_map_invert_y=false |
||||
stream=false |
||||
size_limit=0 |
||||
detect_3d=true |
||||
svg/scale=1.0 |
After Width: | Height: | Size: 3.9 KiB |
@ -0,0 +1,35 @@
@@ -0,0 +1,35 @@
|
||||
[remap] |
||||
|
||||
importer="texture" |
||||
type="StreamTexture" |
||||
path="res://.import/car-full.png-2c1e401ef60c637738e9b43291418fbc.stex" |
||||
metadata={ |
||||
"vram_texture": false |
||||
} |
||||
|
||||
[deps] |
||||
|
||||
source_file="res://Sprites/alistair/car-full.png" |
||||
dest_files=[ "res://.import/car-full.png-2c1e401ef60c637738e9b43291418fbc.stex" ] |
||||
|
||||
[params] |
||||
|
||||
compress/mode=0 |
||||
compress/lossy_quality=0.7 |
||||
compress/hdr_mode=0 |
||||
compress/bptc_ldr=0 |
||||
compress/normal_map=0 |
||||
flags/repeat=0 |
||||
flags/filter=true |
||||
flags/mipmaps=false |
||||
flags/anisotropic=false |
||||
flags/srgb=2 |
||||
process/fix_alpha_border=true |
||||
process/premult_alpha=false |
||||
process/HDR_as_SRGB=false |
||||
process/invert_color=false |
||||
process/normal_map_invert_y=false |
||||
stream=false |
||||
size_limit=0 |
||||
detect_3d=true |
||||
svg/scale=1.0 |
After Width: | Height: | Size: 2.8 KiB |
@ -0,0 +1,35 @@
@@ -0,0 +1,35 @@
|
||||
[remap] |
||||
|
||||
importer="texture" |
||||
type="StreamTexture" |
||||
path="res://.import/car.png-9f335fa2876abcec914947ec4f8f3902.stex" |
||||
metadata={ |
||||
"vram_texture": false |
||||
} |
||||
|
||||
[deps] |
||||
|
||||
source_file="res://Sprites/alistair/car.png" |
||||
dest_files=[ "res://.import/car.png-9f335fa2876abcec914947ec4f8f3902.stex" ] |
||||
|
||||
[params] |
||||
|
||||
compress/mode=0 |
||||
compress/lossy_quality=0.7 |
||||
compress/hdr_mode=0 |
||||
compress/bptc_ldr=0 |
||||
compress/normal_map=0 |
||||
flags/repeat=0 |
||||
flags/filter=true |
||||
flags/mipmaps=false |
||||
flags/anisotropic=false |
||||
flags/srgb=2 |
||||
process/fix_alpha_border=true |
||||
process/premult_alpha=false |
||||
process/HDR_as_SRGB=false |
||||
process/invert_color=false |
||||
process/normal_map_invert_y=false |
||||
stream=false |
||||
size_limit=0 |
||||
detect_3d=true |
||||
svg/scale=1.0 |
After Width: | Height: | Size: 1.0 KiB |
@ -0,0 +1,35 @@
@@ -0,0 +1,35 @@
|
||||
[remap] |
||||
|
||||
importer="texture" |
||||
type="StreamTexture" |
||||
path="res://.import/left.png-453be290be6ab754f1df243900cc4d6a.stex" |
||||
metadata={ |
||||
"vram_texture": false |
||||
} |
||||
|
||||
[deps] |
||||
|
||||
source_file="res://Sprites/alistair/left.png" |
||||
dest_files=[ "res://.import/left.png-453be290be6ab754f1df243900cc4d6a.stex" ] |
||||
|
||||
[params] |
||||
|
||||
compress/mode=0 |
||||
compress/lossy_quality=0.7 |
||||
compress/hdr_mode=0 |
||||
compress/bptc_ldr=0 |
||||
compress/normal_map=0 |
||||
flags/repeat=0 |
||||
flags/filter=true |
||||
flags/mipmaps=false |
||||
flags/anisotropic=false |
||||
flags/srgb=2 |
||||
process/fix_alpha_border=true |
||||
process/premult_alpha=false |
||||
process/HDR_as_SRGB=false |
||||
process/invert_color=false |
||||
process/normal_map_invert_y=false |
||||
stream=false |
||||
size_limit=0 |
||||
detect_3d=true |
||||
svg/scale=1.0 |
After Width: | Height: | Size: 935 B |
@ -0,0 +1,35 @@
@@ -0,0 +1,35 @@
|
||||
[remap] |
||||
|
||||
importer="texture" |
||||
type="StreamTexture" |
||||
path="res://.import/left.png-0ab7d68e67a10834ebf4b11b8ec91c9e.stex" |
||||
metadata={ |
||||
"vram_texture": false |
||||
} |
||||
|
||||
[deps] |
||||
|
||||
source_file="res://Sprites/joe/left.png" |
||||
dest_files=[ "res://.import/left.png-0ab7d68e67a10834ebf4b11b8ec91c9e.stex" ] |
||||
|
||||
[params] |
||||
|
||||
compress/mode=0 |
||||
compress/lossy_quality=0.7 |
||||
compress/hdr_mode=0 |
||||
compress/bptc_ldr=0 |
||||
compress/normal_map=0 |
||||
flags/repeat=0 |
||||
flags/filter=true |
||||
flags/mipmaps=false |
||||
flags/anisotropic=false |
||||
flags/srgb=2 |
||||
process/fix_alpha_border=true |
||||
process/premult_alpha=false |
||||
process/HDR_as_SRGB=false |
||||
process/invert_color=false |
||||
process/normal_map_invert_y=false |
||||
stream=false |
||||
size_limit=0 |
||||
detect_3d=true |
||||
svg/scale=1.0 |