Skip to content

bomberman plyr init #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions bomberman/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Normalize EOL for all files that Git considers text files.
* text=auto eol=lf
3 changes: 3 additions & 0 deletions bomberman/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Godot 4+ specific ignores
.godot/
/android/
1 change: 1 addition & 0 deletions bomberman/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions bomberman/icon.svg.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://c8mce7ud5afe8"
path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://icon.svg"
dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.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
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false
18 changes: 18 additions & 0 deletions bomberman/main.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
extends Node


# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
print("Hello world")
$Label.text = "hello"
$Label.modulate = Color.LIGHT_CORAL

# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta: float) -> void:
# pass
func _input(event):
if event.is_action_pressed("space"):
$Label.modulate = Color.AQUA
if event.is_action_released("space"):
$Label.modulate = Color.BEIGE
52 changes: 52 additions & 0 deletions bomberman/main.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
[gd_scene load_steps=7 format=3 uid="uid://be5cursvdxllf"]

[ext_resource type="Script" path="res://main.gd" id="1_74wy1"]
[ext_resource type="Script" path="res://player.gd" id="2_qh08q"]
[ext_resource type="Texture2D" uid="uid://i1cji5w0y4v8" path="res://playerGrey_walk1.png" id="2_vs306"]
[ext_resource type="Texture2D" uid="uid://ca7hg2veb4kg2" path="res://playerGrey_walk2.png" id="3_68pyg"]

[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_3l5n7"]

[sub_resource type="SpriteFrames" id="SpriteFrames_uix86"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": ExtResource("2_vs306")
}, {
"duration": 1.0,
"texture": ExtResource("3_68pyg")
}],
"loop": true,
"name": &"walk",
"speed": 5.0
}]

[node name="Main" type="Node"]
script = ExtResource("1_74wy1")

[node name="Label" type="Label" parent="."]
anchors_preset = -1
anchor_left = 0.199
anchor_top = 0.155
anchor_right = 0.199
anchor_bottom = 0.155
offset_left = -21.248
offset_top = -11.44
offset_right = 20.752
offset_bottom = 11.56
text = "Label"

[node name="Player" type="CharacterBody2D" parent="."]
script = ExtResource("2_qh08q")

[node name="CollisionShape2D" type="CollisionShape2D" parent="Player"]
shape = SubResource("CapsuleShape2D_3l5n7")

[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="Player"]
position = Vector2(388, 376)
sprite_frames = SubResource("SpriteFrames_uix86")
animation = &"walk"
frame = 1
frame_progress = 0.0374385

[node name="TileMapLayer" type="TileMapLayer" parent="."]
33 changes: 33 additions & 0 deletions bomberman/player.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
extends CharacterBody2D


# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.


# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
if velocity.x != 0:
$AnimatedSprite2D.animation = "walk"
$AnimatedSprite2D.flip_v = false
$AnimatedSprite2D.flip_h = velocity.x < 0
elif velocity.y != 0:
$AnimatedSprite2D.animation = "up"
$AnimatedSprite2D.flip_v = velocity.y > 0

func _input(event: InputEvent) -> void:
var move = Vector2()
if event.is_action_pressed("space"):
print("action pressed")

if event.is_action_released("space"):
print("action released")
if event.is_action_pressed("ui_left"):
velocity.x = velocity.x -1
move.x -= 1
move_and_slide()
if event.is_action_pressed("ui_right"):
velocity.x = velocity.x +1
move.x += 1
move_and_slide()
Binary file added bomberman/playerGrey_walk1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions bomberman/playerGrey_walk1.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://i1cji5w0y4v8"
path="res://.godot/imported/playerGrey_walk1.png-cc737e5947095223c3494468704ca885.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://playerGrey_walk1.png"
dest_files=["res://.godot/imported/playerGrey_walk1.png-cc737e5947095223c3494468704ca885.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
Binary file added bomberman/playerGrey_walk2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions bomberman/playerGrey_walk2.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://ca7hg2veb4kg2"
path="res://.godot/imported/playerGrey_walk2.png-f5cfaf08bfb66680dc47cac4becdc491.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://playerGrey_walk2.png"
dest_files=["res://.godot/imported/playerGrey_walk2.png-f5cfaf08bfb66680dc47cac4becdc491.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
29 changes: 29 additions & 0 deletions bomberman/project.godot
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
; Engine configuration file.
; It's best edited using the editor UI and not directly,
; since the parameters that go here are not all obvious.
;
; Format:
; [section] ; section goes between []
; param=value ; assign values to parameters

config_version=5

[application]

config/name="New Game Project"
run/main_scene="res://main.tscn"
config/features=PackedStringArray("4.3", "GL Compatibility")
config/icon="res://icon.svg"

[input]

space={
"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":32,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}

[rendering]

renderer/rendering_method="gl_compatibility"
renderer/rendering_method.mobile="gl_compatibility"