Merge branch 'master' of http://2ndbeam.ru/git/RenVi/DD
This commit is contained in:
commit
35050d332a
8 changed files with 126 additions and 3 deletions
BIN
assets/blocks_programm/play_script.png
Normal file
BIN
assets/blocks_programm/play_script.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 228 B |
34
assets/blocks_programm/play_script.png.import
Normal file
34
assets/blocks_programm/play_script.png.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://0p2fn0fpolbt"
|
||||
path="res://.godot/imported/play_script.png-bd75c2fae91648868a24468da713763f.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/blocks_programm/play_script.png"
|
||||
dest_files=["res://.godot/imported/play_script.png-bd75c2fae91648868a24468da713763f.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
|
|
@ -24,6 +24,24 @@ window/size/viewport_height=720
|
|||
|
||||
project/assembly_name="DD"
|
||||
|
||||
[input]
|
||||
|
||||
wheel_up={
|
||||
"deadzone": 0.2,
|
||||
"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":8,"position":Vector2(139, 22),"global_position":Vector2(148, 70),"factor":1.0,"button_index":4,"canceled":false,"pressed":true,"double_click":false,"script":null)
|
||||
]
|
||||
}
|
||||
wheel_down={
|
||||
"deadzone": 0.2,
|
||||
"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":0,"position":Vector2(0, 0),"global_position":Vector2(0, 0),"factor":1.0,"button_index":5,"canceled":false,"pressed":false,"double_click":false,"script":null)
|
||||
]
|
||||
}
|
||||
mouse_press={
|
||||
"deadzone": 0.2,
|
||||
"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":1,"position":Vector2(11, 13),"global_position":Vector2(20, 61),"factor":1.0,"button_index":1,"canceled":false,"pressed":true,"double_click":false,"script":null)
|
||||
]
|
||||
}
|
||||
|
||||
[rendering]
|
||||
|
||||
textures/canvas_textures/default_texture_filter=0
|
||||
|
|
14
scenes/blocks_programming/beatle.tscn
Normal file
14
scenes/blocks_programming/beatle.tscn
Normal file
|
@ -0,0 +1,14 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://i3u4tuahol83"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://crq58656204me" path="res://assets/blocks_programm/beatle.png" id="1_e2y7o"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_mlwwt"]
|
||||
size = Vector2(8, 8)
|
||||
|
||||
[node name="CharacterBody2D" type="CharacterBody2D"]
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
texture = ExtResource("1_e2y7o")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource("RectangleShape2D_mlwwt")
|
|
@ -1,7 +1,8 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://bv4rxfc4hm6t7"]
|
||||
[gd_scene load_steps=4 format=3 uid="uid://bv4rxfc4hm6t7"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://bv27o64fwb1l1" path="res://scenes/blocks/step.tscn" id="1_n7yau"]
|
||||
[ext_resource type="PackedScene" uid="uid://r3u4855s3sbq" path="res://scenes/blocks/turn.tscn" id="2_i14ye"]
|
||||
[ext_resource type="Texture2D" uid="uid://0p2fn0fpolbt" path="res://assets/blocks_programm/play_script.png" id="3_i14ye"]
|
||||
|
||||
[node name="LevelHandler" type="Control"]
|
||||
layout_mode = 3
|
||||
|
@ -75,6 +76,23 @@ anchor_right = 0.163
|
|||
anchor_bottom = 0.05
|
||||
offset_left = 0.0249977
|
||||
offset_right = 269.025
|
||||
offset_bottom = 647.0
|
||||
offset_bottom = 606.0
|
||||
mouse_filter = 2
|
||||
theme_override_constants/separation = 50
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="ColorRect"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 12
|
||||
anchor_top = 1.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_top = -46.0
|
||||
offset_right = -6.10352e-05
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 0
|
||||
|
||||
[node name="TextureButtonPlayScript" type="TextureButton" parent="ColorRect/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 6
|
||||
size_flags_vertical = 4
|
||||
texture_normal = ExtResource("3_i14ye")
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://qtbj61yxud26"]
|
||||
[gd_scene load_steps=6 format=3 uid="uid://qtbj61yxud26"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://nmmuvdffrtuu" path="res://scripts/blocks_programm/base_level.gd" id="1_ishh6"]
|
||||
[ext_resource type="Texture2D" uid="uid://c6p5jv6qlgjp5" path="res://assets/blocks_programm/tile_set.png" id="1_v4bdw"]
|
||||
[ext_resource type="PackedScene" uid="uid://i3u4tuahol83" path="res://scenes/blocks_programming/beatle.tscn" id="2_yi2kq"]
|
||||
|
||||
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_yi2kq"]
|
||||
texture = ExtResource("1_v4bdw")
|
||||
|
@ -26,10 +28,16 @@ texture = ExtResource("1_v4bdw")
|
|||
2:8/0 = 0
|
||||
|
||||
[sub_resource type="TileSet" id="TileSet_ishh6"]
|
||||
tile_size = Vector2i(32, 32)
|
||||
sources/0 = SubResource("TileSetAtlasSource_yi2kq")
|
||||
|
||||
[node name="base_level" type="Node2D"]
|
||||
script = ExtResource("1_ishh6")
|
||||
|
||||
[node name="TileMap" type="TileMap" parent="."]
|
||||
tile_set = SubResource("TileSet_ishh6")
|
||||
format = 2
|
||||
|
||||
[node name="Beatle" parent="." instance=ExtResource("2_yi2kq")]
|
||||
|
||||
[node name="Camera2D" type="Camera2D" parent="."]
|
||||
|
|
30
scripts/blocks_programm/base_level.gd
Normal file
30
scripts/blocks_programm/base_level.gd
Normal file
|
@ -0,0 +1,30 @@
|
|||
extends Node2D
|
||||
const UP = 4
|
||||
const DOWN = 1
|
||||
|
||||
var poss = Vector2()
|
||||
var cam = Vector2()
|
||||
var pressed = false
|
||||
|
||||
|
||||
@onready var camera: Camera2D = $Camera2D
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if Input.is_action_just_released("wheel_up") and camera.zoom.x < UP:
|
||||
camera.zoom.x += 0.1
|
||||
camera.zoom.y += 0.1
|
||||
if Input.is_action_just_released("wheel_down")and camera.zoom.x > DOWN:
|
||||
camera.zoom.x -= 0.1
|
||||
camera.zoom.y -= 0.1
|
||||
if pressed:
|
||||
camera.position = (cam + poss) - (camera.get_local_mouse_position())
|
||||
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
if event.is_action("mouse_press"):
|
||||
if event.is_pressed():
|
||||
poss = camera.get_local_mouse_position()
|
||||
cam = camera.position
|
||||
pressed = true
|
||||
else:
|
||||
pressed = false
|
1
scripts/blocks_programm/base_level.gd.uid
Normal file
1
scripts/blocks_programm/base_level.gd.uid
Normal file
|
@ -0,0 +1 @@
|
|||
uid://nmmuvdffrtuu
|
Loading…
Add table
Add a link
Reference in a new issue