mirror of
https://git.kittycat.homes/zoe/codename-routes.git
synced 2024-08-15 03:18:26 +00:00
basic tiles
This commit is contained in:
parent
77784325eb
commit
0ac3e2c423
31 changed files with 306 additions and 0 deletions
3
.import/blue.png-2cd44d93824d3f98709a3749551f4ec1.md5
Normal file
3
.import/blue.png-2cd44d93824d3f98709a3749551f4ec1.md5
Normal file
|
@ -0,0 +1,3 @@
|
|||
source_md5="c2ceedfd75487630e8ea3dabf6a2b9a8"
|
||||
dest_md5="e8cb687282207ab1f7b495245c9750c7"
|
||||
|
BIN
.import/blue.png-2cd44d93824d3f98709a3749551f4ec1.stex
Normal file
BIN
.import/blue.png-2cd44d93824d3f98709a3749551f4ec1.stex
Normal file
Binary file not shown.
3
.import/green.png-448f4aac7f20aee9994c54bdb3cf1731.md5
Normal file
3
.import/green.png-448f4aac7f20aee9994c54bdb3cf1731.md5
Normal file
|
@ -0,0 +1,3 @@
|
|||
source_md5="669feed92f644398c1a1d4d49c923eea"
|
||||
dest_md5="7f94170f05bbe3f73f5199f234b905ea"
|
||||
|
BIN
.import/green.png-448f4aac7f20aee9994c54bdb3cf1731.stex
Normal file
BIN
.import/green.png-448f4aac7f20aee9994c54bdb3cf1731.stex
Normal file
Binary file not shown.
|
@ -0,0 +1,3 @@
|
|||
source_md5="6bb298972ae11c8c9821caed7f258b66"
|
||||
dest_md5="f2fd136a7ef0a6e044086e2ba56227c3"
|
||||
|
BIN
.import/mulfok62-1x.png-6ecf59a597dd7a67f5b738d2c0239b7b.stex
Normal file
BIN
.import/mulfok62-1x.png-6ecf59a597dd7a67f5b738d2c0239b7b.stex
Normal file
Binary file not shown.
3
.import/outline.png-254141a7dcf1bc01b7e07098c4c1c7a1.md5
Normal file
3
.import/outline.png-254141a7dcf1bc01b7e07098c4c1c7a1.md5
Normal file
|
@ -0,0 +1,3 @@
|
|||
source_md5="2752f228fecaeb92e0f2b076c28027ea"
|
||||
dest_md5="878ce27f3864533955dba347e3812976"
|
||||
|
BIN
.import/outline.png-254141a7dcf1bc01b7e07098c4c1c7a1.stex
Normal file
BIN
.import/outline.png-254141a7dcf1bc01b7e07098c4c1c7a1.stex
Normal file
Binary file not shown.
3
.import/red.png-c3051ca11bb5b8c8686a8a85a9586dff.md5
Normal file
3
.import/red.png-c3051ca11bb5b8c8686a8a85a9586dff.md5
Normal file
|
@ -0,0 +1,3 @@
|
|||
source_md5="0bc636281e64916e731a8a6d8e40c0ff"
|
||||
dest_md5="6af147d917b3d1ad2cb9fce4daf43d3d"
|
||||
|
BIN
.import/red.png-c3051ca11bb5b8c8686a8a85a9586dff.stex
Normal file
BIN
.import/red.png-c3051ca11bb5b8c8686a8a85a9586dff.stex
Normal file
Binary file not shown.
3
.import/yellow.png-90e160c7824b62ddeb574a5e60507be3.md5
Normal file
3
.import/yellow.png-90e160c7824b62ddeb574a5e60507be3.md5
Normal file
|
@ -0,0 +1,3 @@
|
|||
source_md5="938048d60ddee2a80d56cecd6002b6e9"
|
||||
dest_md5="92b4a796b3e171c0e7f0d6ada0086ab6"
|
||||
|
BIN
.import/yellow.png-90e160c7824b62ddeb574a5e60507be3.stex
Normal file
BIN
.import/yellow.png-90e160c7824b62ddeb574a5e60507be3.stex
Normal file
Binary file not shown.
8
Map/Map.tscn
Normal file
8
Map/Map.tscn
Normal file
|
@ -0,0 +1,8 @@
|
|||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://Map/TileHandler.gd" type="Script" id=1]
|
||||
|
||||
[node name="Map" type="Node2D"]
|
||||
|
||||
[node name="TileHandler" type="Node2D" parent="."]
|
||||
script = ExtResource( 1 )
|
30
Map/Tile.gd
Normal file
30
Map/Tile.gd
Normal file
|
@ -0,0 +1,30 @@
|
|||
extends Area2D
|
||||
enum outline_colors{RED, BLUE, GREEN, YELLOW}
|
||||
var tile_id = Vector2(0,0)
|
||||
|
||||
func change_color_to(color):
|
||||
var sprite = $Sprite
|
||||
if color == outline_colors.RED:
|
||||
sprite.texture = preload("res://Resources/Graphics/Tiles/red.png")
|
||||
elif color == outline_colors.BLUE:
|
||||
sprite.texture = preload("res://Resources/Graphics/Tiles/blue.png")
|
||||
elif color == outline_colors.GREEN:
|
||||
sprite.texture = preload("res://Resources/Graphics/Tiles/green.png")
|
||||
elif color == outline_colors.YELLOW:
|
||||
sprite.texture = preload("res://Resources/Graphics/Tiles/yellow.png")
|
||||
|
||||
func set_tile_id(id: Vector2):
|
||||
tile_id = id
|
||||
change_color_to(determine_color(id))
|
||||
set_position(id)
|
||||
|
||||
func determine_color(id: Vector2) -> int:
|
||||
var rng = RandomNumberGenerator.new()
|
||||
rng.randomize()
|
||||
return rng.randi_range(1, outline_colors.size() - 1)
|
||||
|
||||
func set_position(id: Vector2):
|
||||
position.x = id.x * 32
|
||||
position.y = id.y * 26
|
||||
if (fmod(id.y, 2)) == 0:
|
||||
position.x += 16
|
13
Map/Tile.tscn
Normal file
13
Map/Tile.tscn
Normal file
|
@ -0,0 +1,13 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://Resources/Graphics/Tiles/yellow.png" type="Texture" id=1]
|
||||
[ext_resource path="res://Map/Tile.gd" type="Script" id=2]
|
||||
|
||||
[node name="Tile" type="Area2D"]
|
||||
script = ExtResource( 2 )
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."]
|
||||
polygon = PoolVector2Array( -15, -9, -14, -10, -12, -11, -9, -12, -7, -13, -4, -14, -2, -15, 2, -15, 4, -14, 7, -13, 9, -12, 12, -11, 14, -10, 15, -9, 15, 9, 14, 10, 12, 11, 9, 12, 7, 13, 4, 14, 2, 15, -2, 15, -4, 14, -7, 13, -9, 12, -12, 11, -14, 10, -15, 9 )
|
15
Map/TileHandler.gd
Normal file
15
Map/TileHandler.gd
Normal file
|
@ -0,0 +1,15 @@
|
|||
extends Node2D
|
||||
export var map_size = Vector2(24, 24)
|
||||
var tiles = []
|
||||
|
||||
func _ready() -> void:
|
||||
spawn()
|
||||
|
||||
func spawn():
|
||||
var Tile = preload("res://Map/Tile.tscn")
|
||||
for x in range(0, map_size.x - 1):
|
||||
for y in range (0, map_size.y - 1):
|
||||
var tile = Tile.instance()
|
||||
tile.set_tile_id(Vector2(x,y))
|
||||
tiles.append(tile)
|
||||
add_child(tile)
|
BIN
Resources/External/Graphics/Tiles/outline.ase
vendored
Normal file
BIN
Resources/External/Graphics/Tiles/outline.ase
vendored
Normal file
Binary file not shown.
BIN
Resources/External/Graphics/Tiles/outline.png
vendored
Normal file
BIN
Resources/External/Graphics/Tiles/outline.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 193 B |
35
Resources/External/Graphics/Tiles/outline.png.import
vendored
Normal file
35
Resources/External/Graphics/Tiles/outline.png.import
vendored
Normal file
|
@ -0,0 +1,35 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/outline.png-254141a7dcf1bc01b7e07098c4c1c7a1.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Resources/External/Graphics/Tiles/outline.png"
|
||||
dest_files=[ "res://.import/outline.png-254141a7dcf1bc01b7e07098c4c1c7a1.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
Resources/External/Graphics/mulfok62-1x.png
vendored
Normal file
BIN
Resources/External/Graphics/mulfok62-1x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 347 B |
35
Resources/External/Graphics/mulfok62-1x.png.import
vendored
Normal file
35
Resources/External/Graphics/mulfok62-1x.png.import
vendored
Normal file
|
@ -0,0 +1,35 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/mulfok62-1x.png-6ecf59a597dd7a67f5b738d2c0239b7b.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Resources/External/Graphics/mulfok62-1x.png"
|
||||
dest_files=[ "res://.import/mulfok62-1x.png-6ecf59a597dd7a67f5b738d2c0239b7b.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
Resources/Graphics/Tiles/blue.png
Normal file
BIN
Resources/Graphics/Tiles/blue.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 278 B |
35
Resources/Graphics/Tiles/blue.png.import
Normal file
35
Resources/Graphics/Tiles/blue.png.import
Normal file
|
@ -0,0 +1,35 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/blue.png-2cd44d93824d3f98709a3749551f4ec1.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Resources/Graphics/Tiles/blue.png"
|
||||
dest_files=[ "res://.import/blue.png-2cd44d93824d3f98709a3749551f4ec1.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=false
|
||||
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=false
|
||||
svg/scale=1.0
|
BIN
Resources/Graphics/Tiles/green.png
Normal file
BIN
Resources/Graphics/Tiles/green.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 277 B |
35
Resources/Graphics/Tiles/green.png.import
Normal file
35
Resources/Graphics/Tiles/green.png.import
Normal file
|
@ -0,0 +1,35 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/green.png-448f4aac7f20aee9994c54bdb3cf1731.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Resources/Graphics/Tiles/green.png"
|
||||
dest_files=[ "res://.import/green.png-448f4aac7f20aee9994c54bdb3cf1731.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=false
|
||||
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=false
|
||||
svg/scale=1.0
|
BIN
Resources/Graphics/Tiles/red.png
Normal file
BIN
Resources/Graphics/Tiles/red.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 278 B |
35
Resources/Graphics/Tiles/red.png.import
Normal file
35
Resources/Graphics/Tiles/red.png.import
Normal file
|
@ -0,0 +1,35 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/red.png-c3051ca11bb5b8c8686a8a85a9586dff.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Resources/Graphics/Tiles/red.png"
|
||||
dest_files=[ "res://.import/red.png-c3051ca11bb5b8c8686a8a85a9586dff.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=false
|
||||
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=false
|
||||
svg/scale=1.0
|
BIN
Resources/Graphics/Tiles/yellow.png
Normal file
BIN
Resources/Graphics/Tiles/yellow.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 279 B |
35
Resources/Graphics/Tiles/yellow.png.import
Normal file
35
Resources/Graphics/Tiles/yellow.png.import
Normal file
|
@ -0,0 +1,35 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/yellow.png-90e160c7824b62ddeb574a5e60507be3.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Resources/Graphics/Tiles/yellow.png"
|
||||
dest_files=[ "res://.import/yellow.png-90e160c7824b62ddeb574a5e60507be3.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=false
|
||||
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=false
|
||||
svg/scale=1.0
|
|
@ -1,5 +1,7 @@
|
|||
[gd_resource type="Environment" load_steps=2 format=2]
|
||||
|
||||
[sub_resource type="ProceduralSky" id=1]
|
||||
|
||||
[resource]
|
||||
background_mode = 2
|
||||
background_sky = SubResource( 1 )
|
||||
|
|
|
@ -11,8 +11,18 @@ config_version=4
|
|||
[application]
|
||||
|
||||
config/name="codename-routes"
|
||||
run/main_scene="res://Map/Map.tscn"
|
||||
boot_splash/fullsize=false
|
||||
config/icon="res://icon.png"
|
||||
|
||||
[display]
|
||||
|
||||
window/size/width=640
|
||||
window/size/height=360
|
||||
window/size/test_height=1
|
||||
window/stretch/mode="2d"
|
||||
window/stretch/aspect="keep"
|
||||
|
||||
[physics]
|
||||
|
||||
common/enable_pause_aware_picking=true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue