Merge pull request 'TentativePlayer' (#1) from TentativePlayer into main
Reviewed-on: #1
This commit is contained in:
commit
39e34e9be1
4 changed files with 78 additions and 5 deletions
|
@ -11,30 +11,40 @@ config_version=5
|
||||||
[application]
|
[application]
|
||||||
|
|
||||||
config/name="code-game-jam-drop-plafond-2025"
|
config/name="code-game-jam-drop-plafond-2025"
|
||||||
run/main_scene="res://menu_principal/menu_principal_affichage.tscn"
|
run/main_scene="res://scenes/Room.tscn"
|
||||||
config/features=PackedStringArray("4.3", "GL Compatibility")
|
config/features=PackedStringArray("4.3", "GL Compatibility")
|
||||||
config/icon="res://ressources/images/icon.svg"
|
config/icon="res://ressources/images/icon.svg"
|
||||||
|
|
||||||
|
[display]
|
||||||
|
|
||||||
|
window/size/viewport_width=1280
|
||||||
|
window/size/viewport_height=720
|
||||||
|
window/stretch/mode="canvas_items"
|
||||||
|
|
||||||
|
[dotnet]
|
||||||
|
|
||||||
|
project/assembly_name="code-game-jam-drop-plafond-2025"
|
||||||
|
|
||||||
[input]
|
[input]
|
||||||
|
|
||||||
BOUGER_HAUT={
|
BOUGER_HAUT={
|
||||||
"deadzone": 0.5,
|
"deadzone": 0.5,
|
||||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":90,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":122,"location":0,"echo":false,"script":null)
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
BOUGER_BAS={
|
BOUGER_BAS={
|
||||||
"deadzone": 0.5,
|
"deadzone": 0.5,
|
||||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":115,"location":0,"echo":false,"script":null)
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
BOUGER_DROITE={
|
BOUGER_DROITE={
|
||||||
"deadzone": 0.5,
|
"deadzone": 0.5,
|
||||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":100,"location":0,"echo":false,"script":null)
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
BOUGER_GAUCHE={
|
BOUGER_GAUCHE={
|
||||||
"deadzone": 0.5,
|
"deadzone": 0.5,
|
||||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":81,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":113,"location":0,"echo":false,"script":null)
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
PAUSE={
|
PAUSE={
|
||||||
|
|
31
scenes/Room.tscn
Normal file
31
scenes/Room.tscn
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
[gd_scene load_steps=3 format=3 uid="uid://durhes43gex7a"]
|
||||||
|
|
||||||
|
[ext_resource type="PackedScene" uid="uid://c7bfiw54rvaq2" path="res://scenes/player_melodie.tscn" id="1_cl1wt"]
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_18mp2"]
|
||||||
|
size = Vector2(1280, 720)
|
||||||
|
|
||||||
|
[node name="Room" type="Node2D"]
|
||||||
|
|
||||||
|
[node name="Player_Melodie" parent="." instance=ExtResource("1_cl1wt")]
|
||||||
|
position = Vector2(0, -9)
|
||||||
|
|
||||||
|
[node name="Camera2D" type="Camera2D" parent="."]
|
||||||
|
|
||||||
|
[node name="StaticBody2D" type="StaticBody2D" parent="."]
|
||||||
|
|
||||||
|
[node name="Bottom Wall" type="CollisionShape2D" parent="StaticBody2D"]
|
||||||
|
position = Vector2(3, 721)
|
||||||
|
shape = SubResource("RectangleShape2D_18mp2")
|
||||||
|
|
||||||
|
[node name="Top Wall" type="CollisionShape2D" parent="StaticBody2D"]
|
||||||
|
position = Vector2(0, -719)
|
||||||
|
shape = SubResource("RectangleShape2D_18mp2")
|
||||||
|
|
||||||
|
[node name="Left Wall" type="CollisionShape2D" parent="StaticBody2D"]
|
||||||
|
position = Vector2(-1278, -2)
|
||||||
|
shape = SubResource("RectangleShape2D_18mp2")
|
||||||
|
|
||||||
|
[node name="Right Wall" type="CollisionShape2D" parent="StaticBody2D"]
|
||||||
|
position = Vector2(1280, -4)
|
||||||
|
shape = SubResource("RectangleShape2D_18mp2")
|
17
scenes/player_melodie.tscn
Normal file
17
scenes/player_melodie.tscn
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
[gd_scene load_steps=4 format=3 uid="uid://c7bfiw54rvaq2"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://scripts/player_control.gd" id="1_7sg4g"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://b4viqupj5q0je" path="res://ressources/images/icon.svg" id="1_w50ia"]
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_trcma"]
|
||||||
|
size = Vector2(122, 128)
|
||||||
|
|
||||||
|
[node name="Player_Melodie" type="CharacterBody2D"]
|
||||||
|
script = ExtResource("1_7sg4g")
|
||||||
|
|
||||||
|
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||||
|
texture = ExtResource("1_w50ia")
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
|
position = Vector2(-1, 0)
|
||||||
|
shape = SubResource("RectangleShape2D_trcma")
|
15
scripts/player_control.gd
Normal file
15
scripts/player_control.gd
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
extends CharacterBody2D
|
||||||
|
|
||||||
|
const move_speed = 400
|
||||||
|
|
||||||
|
func _physics_process(delta: float) -> void:
|
||||||
|
move_and_slide()
|
||||||
|
|
||||||
|
func _process(delta: float) -> void:
|
||||||
|
var direction : Vector2 = Vector2.ZERO
|
||||||
|
direction.x = Input.get_action_raw_strength("BOUGER_DROITE") - Input.get_action_raw_strength("BOUGER_GAUCHE")
|
||||||
|
direction.y = Input.get_action_raw_strength("BOUGER_BAS") - Input.get_action_raw_strength("BOUGER_HAUT")
|
||||||
|
|
||||||
|
velocity = direction * move_speed
|
||||||
|
|
||||||
|
pass
|
Loading…
Add table
Reference in a new issue