diff --git a/scenes/map_01.tscn b/scenes/map_01.tscn index c9067ed..c17af3d 100644 --- a/scenes/map_01.tscn +++ b/scenes/map_01.tscn @@ -1,11 +1,50 @@ -[gd_scene load_steps=9 format=4 uid="uid://dghq8c8asg7h1"] +[gd_scene load_steps=14 format=4 uid="uid://dghq8c8asg7h1"] +[ext_resource type="Texture2D" uid="uid://bu05e161cb61k" path="res://sprites/background/spritesheet_bg.png" id="1_q6ynt"] [ext_resource type="TileSet" uid="uid://beswbm12qkkxk" path="res://sprites/spritesheet_road/bg_road.tres" id="2_i1338"] [ext_resource type="TileSet" uid="uid://buu8w8n61kbxf" path="res://sprites/spritesheet_road/markings.tres" id="3_ktygs"] [ext_resource type="TileSet" uid="uid://b15864hbqomim" path="res://sprites/spritesheet_road/road.tres" id="4_r58io"] +[ext_resource type="Texture2D" uid="uid://dpuhee0x5ekud" path="res://sprites/background/spritesheet_scenery.png" id="5_g78jk"] + +[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_qbu02"] +texture = ExtResource("1_q6ynt") +texture_region_size = Vector2i(256, 256) +0:0/0 = 0 +1:0/0 = 0 +2:0/0 = 0 +3:0/0 = 0 +4:0/0 = 0 +5:0/0 = 0 +6:0/0 = 0 +7:0/0 = 0 +0:1/0 = 0 +1:1/0 = 0 +2:1/0 = 0 +3:1/0 = 0 +4:1/0 = 0 +5:1/0 = 0 +6:1/0 = 0 +7:1/0 = 0 +0:2/0 = 0 +1:2/0 = 0 +2:2/0 = 0 +3:2/0 = 0 +4:2/0 = 0 +5:2/0 = 0 +6:2/0 = 0 +7:2/0 = 0 +0:3/0 = 0 +1:3/0 = 0 +2:3/0 = 0 +3:3/0 = 0 +4:3/0 = 0 +5:3/0 = 0 +6:3/0 = 0 +7:3/0 = 0 [sub_resource type="TileSet" id="TileSet_5knbn"] -tile_size = Vector2i(128, 128) +tile_size = Vector2i(256, 256) +sources/1 = SubResource("TileSetAtlasSource_qbu02") [sub_resource type="RectangleShape2D" id="RectangleShape2D_daqun"] size = Vector2(23, 222) @@ -19,9 +58,142 @@ size = Vector2(20, 126) [sub_resource type="RectangleShape2D" id="RectangleShape2D_82iti"] size = Vector2(20, 231) +[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_hclam"] +texture = ExtResource("5_g78jk") +texture_region_size = Vector2i(128, 128) +2:0/0 = 0 +3:0/0 = 0 +6:0/0 = 0 +7:0/0 = 0 +8:0/0 = 0 +9:0/0 = 0 +10:0/0 = 0 +11:0/0 = 0 +12:0/0 = 0 +13:0/0 = 0 +14:0/0 = 0 +15:0/0 = 0 +2:1/0 = 0 +3:1/0 = 0 +6:1/0 = 0 +7:1/0 = 0 +8:1/0 = 0 +9:1/0 = 0 +10:1/0 = 0 +11:1/0 = 0 +12:1/0 = 0 +13:1/0 = 0 +14:1/0 = 0 +15:1/0 = 0 +0:2/0 = 0 +1:2/0 = 0 +2:2/0 = 0 +3:2/0 = 0 +4:2/0 = 0 +5:2/0 = 0 +6:2/0 = 0 +7:2/0 = 0 +8:2/0 = 0 +9:2/0 = 0 +10:2/0 = 0 +11:2/0 = 0 +12:2/0 = 0 +13:2/0 = 0 +14:2/0 = 0 +15:2/0 = 0 +0:3/0 = 0 +1:3/0 = 0 +2:3/0 = 0 +3:3/0 = 0 +4:3/0 = 0 +5:3/0 = 0 +6:3/0 = 0 +7:3/0 = 0 +8:3/0 = 0 +9:3/0 = 0 +10:3/0 = 0 +11:3/0 = 0 +12:3/0 = 0 +13:3/0 = 0 +14:3/0 = 0 +15:3/0 = 0 +0:4/0 = 0 +1:4/0 = 0 +2:4/0 = 0 +3:4/0 = 0 +4:4/0 = 0 +5:4/0 = 0 +6:4/0 = 0 +7:4/0 = 0 +8:4/0 = 0 +9:4/0 = 0 +10:4/0 = 0 +11:4/0 = 0 +12:4/0 = 0 +13:4/0 = 0 +14:4/0 = 0 +15:4/0 = 0 +0:5/0 = 0 +1:5/0 = 0 +2:5/0 = 0 +3:5/0 = 0 +4:5/0 = 0 +5:5/0 = 0 +6:5/0 = 0 +7:5/0 = 0 +8:5/0 = 0 +9:5/0 = 0 +10:5/0 = 0 +11:5/0 = 0 +12:5/0 = 0 +13:5/0 = 0 +14:5/0 = 0 +15:5/0 = 0 +0:6/0 = 0 +1:6/0 = 0 +2:6/0 = 0 +3:6/0 = 0 +4:6/0 = 0 +5:6/0 = 0 +6:6/0 = 0 +7:6/0 = 0 +8:6/0 = 0 +9:6/0 = 0 +10:6/0 = 0 +11:6/0 = 0 +12:6/0 = 0 +13:6/0 = 0 +14:6/0 = 0 +15:6/0 = 0 +0:7/0 = 0 +1:7/0 = 0 +2:7/0 = 0 +3:7/0 = 0 +4:7/0 = 0 +5:7/0 = 0 +6:7/0 = 0 +7:7/0 = 0 +8:7/0 = 0 +9:7/0 = 0 +10:7/0 = 0 +11:7/0 = 0 +12:7/0 = 0 +13:7/0 = 0 +14:7/0 = 0 +15:7/0 = 0 +0:0/size_in_atlas = Vector2i(2, 2) +0:0/0 = 0 +4:0/size_in_atlas = Vector2i(2, 2) +4:0/0 = 0 + +[sub_resource type="TileSet" id="TileSet_s6rw7"] +tile_size = Vector2i(128, 128) +sources/0 = SubResource("TileSetAtlasSource_hclam") + [node name="Map" type="Node"] [node name="Background" type="TileMapLayer" parent="."] +tile_map_data = PackedByteArray("AAD7////AQAAAAAAAAD8////AQAAAAAAAAD9////AQAAAAAAAAD+////AQAAAAAAAAD/////AQAAAAAAAAAAAP//AQAAAAAAAAABAP//AQAAAAAAAAACAP//AQAAAAAAAAADAP//AQAAAAAAAAAEAP//AQABAAAAACD4//3/AQAAAAAAAAD4//7/AQAAAAAAAAD4////AQAAAAAAAAD4/wAAAQAAAAAAAAD4/wEAAQAAAAAAAAD4/wIAAQABAAAAACD4/wMAAQABAAAAAAD4/wQAAQAAAAAAAAD4/wUAAQAAAAAAAAD4/wYAAQAAAAAAAAD4/wcAAQAAAAAAAAD5//3/AQAAAAAAAAD5//7/AQAAAAAAAAD5////AQABAAAAAAD5/wAAAQABAAAAACD5/wEAAQ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AAAAGAAMAAQAAAAAAAAAGAAQAAQAAAAAAAAAGAAUAAQAAAAAAAAAGAAYAAQAAAAAAAAAGAAcAAQAAAAAAAAAHAP3/AQAAAAAAAAAHAP7/AQAAAAAAAAAHAP//AQAAAAAAAAAHAAAAAQAAAAAAAAAHAAEAAQAAAAAAAAAHAAIAAQAAAAAAAAAHAAMAAQAAAAAAAAAHAAQAAQAAAAAAAAAHAAUAAQAAAAAAAAAHAAYAAQAAAAAAAAAHAAcAAQAAAAAAAAAIAP3/AQAAAAAAAAAIAP7/AQAAAAAAAAAIAP//AQAAAAAAAAAIAAAAAQAAAAAAAAAIAAEAAQAAAAAAAAAIAAIAAQAAAAAAAAAIAAMAAQAAAAAAAAAIAAQAAQAAAAAAAAAIAAUAAQAAAAAAAAAIAAYAAQAAAAAAAAAIAAcAAQAAAAAAAAD3//z/AQAAAAAAAAD3//3/AQAAAAAAAAD3//7/AQAAAAAAAAD3////AQAAAAAAAAD3/wAAAQAAAAAAAAD3/wEAAQAAAAAAAAD3/wIAAQAAAAAAAAD3/wMAAQAAAAAAAAD3/wQAAQAAAAAAAAD3/wUAAQAAAAAAAAD3/wYAAQAAAAAAAAD3/wcAAQAAAAAAAAD4//z/AQAAAAAAAAD5//z/AQAAAAAAAAD6//z/AQAAAAAAAAD7//z/AQAAAAAAAAD8//z/AQAAAAAAAAD9//z/AQAAAAAAAAD+//z/AQAAAAAAAAD///z/AQAAAAAAAAAAAPz/AQAAAAAAAAABAPz/AQAAAAAAAAACAPz/AQAAAAAAAAADAPz/AQAAAAAAAAAEAPz/AQAAAAAAAAAFAPz/AQAAAAAAAAAGAPz/AQAAAAAAAAAHAPz/AQAAAAAAAAAIAPz/AQAAAAAAAAA=") tile_set = SubResource("TileSet_5knbn") collision_enabled = false @@ -81,3 +253,8 @@ collision_mask = 4 [node name="CollisionShape2D" type="CollisionShape2D" parent="area_cp2"] position = Vector2(-384, 0) shape = SubResource("RectangleShape2D_82iti") + +[node name="scenery" type="TileMapLayer" par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HAAEAAAAEAP3/AAAHAAEAAAAMAAkAAAAHAAEAAAD//woAAAAHAAEAAAD7/wkAAAAHAAAAAAD3/wgAAAAHAAAAAAA=") +tile_set = SubResource("TileSet_s6rw7") diff --git a/scripts/car.gd b/scripts/car.gd index 84d4556..c0b1981 100644 --- a/scripts/car.gd +++ b/scripts/car.gd @@ -21,20 +21,20 @@ const COLLISION_SLOWDOWN_WALL=1.2 const STANDSTILLSPEED=0.5 var wheel_base = 60*0.5 -var engine_power = 500 +var engine_power = 350 var friction = -0.5 var drag = -0.0005 var braking = -200 var max_speed_reverse = 100 -var slip_speed = 100 +var slip_speed = 200 var traction_fast = 0.1 #traction when above slip_speed var traction_slow = 0.5 #Automatic Steering settings -var steering_speed_slow = 50 #speed for slow steering +var steering_speed_slow = 100 #speed for slow steering var steering_angle_slow = 50 #maximum angle slow speed var steering_distance_far_slow=200 var steering_distance_close_slow=20 @@ -45,7 +45,7 @@ var steering_distance_far_fast=256 var steering_distance_close_fast=128 # resetCar -var resetcar_stoppedspeed = 30 #activate timer when below this speed +var resetcar_stoppedspeed = 50 #activate timer when below this speed var resetcar_movingspeed=resetcar_stoppedspeed+10 #stop timer when above this speed var resetcar_distance=128 #196 is roughly when car is in the middle of a two wide road var resetcar_steerangle=120 @@ -145,7 +145,6 @@ func get_input(): var turndirection = 1 if distance_fl void: meanCarPosition/=displayedCarCount - camera.position=meanCarPosition - #camera.position=lerp(camera.position,meanCarPosition,CAMERA_POSITION_SPEED*delta) + #camera.position=meanCarPosition + camera.position=lerp(camera.position,meanCarPosition,CAMERA_POSITION_SPEED) #rint("zoom = "+str(camera.zoom)) #camera.zoom=Vector2(1.5,1.5) diff --git a/sprites/background/bg.xcf b/sprites/background/bg.xcf new file mode 100644 index 0000000..3c0e71c Binary files /dev/null and b/sprites/background/bg.xcf differ diff --git a/sprites/background/make_tilemap.sh b/sprites/background/make_tilemap.sh new file mode 100644 index 0000000..e724358 --- /dev/null +++ b/sprites/background/make_tilemap.sh @@ -0,0 +1,8 @@ +#!/bin/sh +mkdir tmp +touch tmp/.gdignore +for i in {0..32}; do magick bg.xcf["${i}"] "tmp/bg_${i}.png"; done +for i in {0..32}; do magick scenery.xcf["${i}"] "tmp/scenery_${i}.png"; done +magick convert tmp/bg_{0..7}.png +append \( tmp/bg_{8..15}.png +append \) -append \( tmp/bg_{16..23}.png +append \) -append \( tmp/bg_{24..31}.png +append \) -append spritesheet_bg.png +#magick convert erstereihe +append \( zweite reihe +append \) -append \( drittereihe +append \) -append out.png +magick convert tmp/scenery_{0..7}.png +append \( tmp/scenery_{8..15}.png +append \) -append \( tmp/scenery_{16..23}.png +append \) -append \( tmp/scenery_{24..31}.png +append \) -append spritesheet_scenery.png \ No newline at end of file diff --git a/sprites/background/scenery.xcf b/sprites/background/scenery.xcf new file mode 100644 index 0000000..c1997b9 Binary files /dev/null and b/sprites/background/scenery.xcf differ diff --git a/sprites/background/spritesheet_bg.png b/sprites/background/spritesheet_bg.png new file mode 100644 index 0000000..b2a1fe0 Binary files /dev/null and b/sprites/background/spritesheet_bg.png differ diff --git a/sprites/background/spritesheet_bg.png.import b/sprites/background/spritesheet_bg.png.import new file mode 100644 index 0000000..8b82f5d --- /dev/null +++ b/sprites/background/spritesheet_bg.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bu05e161cb61k" +path="res://.godot/imported/spritesheet_bg.png-f8094dc6b1d215ad287ae7f1dd688f0a.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://sprites/background/spritesheet_bg.png" +dest_files=["res://.godot/imported/spritesheet_bg.png-f8094dc6b1d215ad287ae7f1dd688f0a.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/sprites/background/spritesheet_scenery.png b/sprites/background/spritesheet_scenery.png new file mode 100644 index 0000000..8c47ca3 Binary files /dev/null and b/sprites/background/spritesheet_scenery.png differ diff --git a/sprites/background/spritesheet_scenery.png.import b/sprites/background/spritesheet_scenery.png.import new file mode 100644 index 0000000..2d53eeb --- /dev/null +++ b/sprites/background/spritesheet_scenery.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dpuhee0x5ekud" +path="res://.godot/imported/spritesheet_scenery.png-790928a91f114b672cc596ccf4ab235e.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://sprites/background/spritesheet_scenery.png" +dest_files=["res://.godot/imported/spritesheet_scenery.png-790928a91f114b672cc596ccf4ab235e.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/sprites/spritesheet_road/make_tilemap.sh b/sprites/spritesheet_road/make_tilemap.sh index 904e173..a6d82ac 100644 --- a/sprites/spritesheet_road/make_tilemap.sh +++ b/sprites/spritesheet_road/make_tilemap.sh @@ -1,5 +1,6 @@ #!/bin/sh mkdir tmp +touch tmp/.gdignore for i in {0..32}; do magick road_1x1.xcf["${i}"] "tmp/road1x1_${i}.png"; done for i in {0..32}; do magick road_2x2.xcf["${i}"] "tmp/road2x2_${i}.png"; done for i in {0..32}; do magick markings_1x1.xcf["${i}"] "tmp/markings1x1_${i}.png"; done