Browse Source

added car inito ch1s1

master
as4s4hetic 3 years ago
parent
commit
83e156b8ce
  1. 55
      Car.gd
  2. 31
      Scenes/Car.tscn
  3. 18
      Scenes/Player.tscn
  4. 2
      Scripts/Ch1S1.gd
  5. BIN
      Sprites/alistair/car-1.png
  6. 35
      Sprites/alistair/car-1.png.import
  7. BIN
      Sprites/alistair/car-2.png
  8. 35
      Sprites/alistair/car-2.png.import
  9. BIN
      Sprites/alistair/car-3.png
  10. 35
      Sprites/alistair/car-3.png.import
  11. BIN
      Sprites/alistair/car-full-1.png
  12. 35
      Sprites/alistair/car-full-1.png.import
  13. BIN
      Sprites/alistair/car-full-2.png
  14. 35
      Sprites/alistair/car-full-2.png.import
  15. BIN
      Sprites/alistair/car-full-3.png
  16. 35
      Sprites/alistair/car-full-3.png.import
  17. BIN
      Sprites/alistair/car-full.png
  18. 35
      Sprites/alistair/car-full.png.import
  19. BIN
      Sprites/alistair/car.png
  20. 35
      Sprites/alistair/car.png.import
  21. BIN
      Sprites/alistair/left.png
  22. 35
      Sprites/alistair/left.png.import
  23. BIN
      Sprites/joe/left.png
  24. 35
      Sprites/joe/left.png.import
  25. 8
      Story/Ch1S1.tscn

55
Car.gd

@ -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")

31
Scenes/Car.tscn

@ -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 )

18
Scenes/Player.tscn

@ -16,9 +16,9 @@ @@ -16,9 +16,9 @@
[sub_resource type="SpriteFrames" id=2]
animations = [ {
"frames": [ ExtResource( 2 ), ExtResource( 6 ), ExtResource( 2 ), ExtResource( 7 ) ],
"frames": [ ExtResource( 3 ) ],
"loop": true,
"name": "MoveDown",
"name": "IdleRight",
"speed": 5.0
}, {
"frames": [ ExtResource( 5 ), ExtResource( 14 ), ExtResource( 5 ), ExtResource( 15 ) ],
@ -36,9 +36,14 @@ animations = [ { @@ -36,9 +36,14 @@ animations = [ {
"name": "MoveRight",
"speed": 5.0
}, {
"frames": [ ExtResource( 3 ) ],
"frames": [ ExtResource( 2 ), ExtResource( 6 ), ExtResource( 2 ), ExtResource( 7 ) ],
"loop": true,
"name": "IdleRight",
"name": "MoveDown",
"speed": 5.0
}, {
"frames": [ ExtResource( 4 ) ],
"loop": true,
"name": "IdleLeft",
"speed": 5.0
}, {
"frames": [ ExtResource( 2 ) ],
@ -50,11 +55,6 @@ animations = [ { @@ -50,11 +55,6 @@ animations = [ {
"loop": true,
"name": "IdleUp",
"speed": 5.0
}, {
"frames": [ ExtResource( 4 ) ],
"loop": true,
"name": "IdleLeft",
"speed": 5.0
} ]
[sub_resource type="CapsuleShape2D" id=4]

2
Scripts/Ch1S1.gd

@ -13,5 +13,5 @@ func _ready(): @@ -13,5 +13,5 @@ func _ready():
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
player.position.y = clamp(player.position.y, 440, 500)
player.position.y = clamp(player.position.y, 480, 500)
pass

BIN
Sprites/alistair/car-1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

35
Sprites/alistair/car-1.png.import

@ -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

BIN
Sprites/alistair/car-2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

35
Sprites/alistair/car-2.png.import

@ -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

BIN
Sprites/alistair/car-3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

35
Sprites/alistair/car-3.png.import

@ -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

BIN
Sprites/alistair/car-full-1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

35
Sprites/alistair/car-full-1.png.import

@ -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

BIN
Sprites/alistair/car-full-2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

35
Sprites/alistair/car-full-2.png.import

@ -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

BIN
Sprites/alistair/car-full-3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

35
Sprites/alistair/car-full-3.png.import

@ -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

BIN
Sprites/alistair/car-full.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

35
Sprites/alistair/car-full.png.import

@ -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

BIN
Sprites/alistair/car.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

35
Sprites/alistair/car.png.import

@ -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

BIN
Sprites/alistair/left.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

35
Sprites/alistair/left.png.import

@ -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

BIN
Sprites/joe/left.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 935 B

35
Sprites/joe/left.png.import

@ -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

8
Story/Ch1S1.tscn

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
[gd_scene load_steps=6 format=2]
[ext_resource path="res://Resources/woods.tres" type="TileSet" id=1]
[ext_resource path="res://Scenes/Player.tscn" type="PackedScene" id=2]
[ext_resource path="res://Scenes/Car.tscn" type="PackedScene" id=2]
[ext_resource path="res://Scripts/ScrollCamera.gd" type="Script" id=3]
[ext_resource path="res://Scripts/Ch1S1.gd" type="Script" id=4]
[ext_resource path="res://Music/Main Menu-Unmastered.mp3" type="AudioStream" id=5]
@ -143,9 +143,6 @@ cell_custom_transform = Transform2D( 30, 0, 0, 0, 0, 0 ) @@ -143,9 +143,6 @@ cell_custom_transform = Transform2D( 30, 0, 0, 0, 0, 0 )
format = 1
tile_data = PoolIntArray( 65536, 7, 0, 65538, 15, 0, 65540, 15, 0, 65542, 15, 0, 65544, 15, 0, 65546, 15, 0, 65548, 15, 0, 65550, 15, 0, 65552, 15, 0, 65554, 15, 0, 65556, 15, 0, 65558, 15, 0, 65560, 15, 0, 65562, 15, 0, 65564, 15, 0, 65566, 15, 0, 65568, 15, 0, 65570, 15, 0, 65572, 15, 0, 65574, 15, 0, 65576, 15, 0, 65578, 15, 0, 65580, 15, 0, 65582, 15, 0, 65584, 7, 0, 65586, 15, 0, 65588, 15, 0, 65590, 15, 0, 65592, 15, 0, 65594, 15, 0, 65596, 15, 0, 65598, 15, 0, 65600, 15, 0, 65602, 15, 0, 65604, 15, 0, 65606, 15, 0, 65608, 15, 0, 65610, 15, 0, 65612, 15, 0, 65614, 15, 0, 65616, 15, 0, 65618, 15, 0, 65620, 15, 0, 65622, 15, 0, 65624, 15, 0, 65626, 15, 0, 65628, 15, 0, 65630, 15, 0, 393218, 21, 0, 393230, 20, 0, 655394, 536870928, 0, 655424, 16, 0, 655430, 536870937, 0, 720896, 16, 0, 720937, 25, 0 )
[node name="Player" parent="." instance=ExtResource( 2 )]
position = Vector2( 480, 480 )
[node name="Foreground" type="ParallaxBackground" parent="."]
layer = 1
@ -175,3 +172,6 @@ tile_data = PoolIntArray( 24, 23, 0, 458752, 12, 0, 458756, 12, 0, 458760, 12, 0 @@ -175,3 +172,6 @@ tile_data = PoolIntArray( 24, 23, 0, 458752, 12, 0, 458756, 12, 0, 458760, 12, 0
[node name="Shrubs" type="TileMap" parent="Foreground/Close"]
tile_set = ExtResource( 1 )
format = 1
[node name="Player" parent="." instance=ExtResource( 2 )]
position = Vector2( 1090, 458 )

Loading…
Cancel
Save