basic skill

This commit is contained in:
Page Asgardius 2024-01-28 17:52:01 -07:00
parent 36583be9db
commit 24e5cbfea9
11 changed files with 88 additions and 15 deletions

View file

@ -1,17 +1,22 @@
extends Label
var housefreedom
var welcometext = ""
var playername
func _ready():
if OS.get_data_dir().begins_with("/home"):
playername = OS.get_data_dir().rsplit("/", true, 7)[2]
else:
playername = "player"
housefreedom = OS.get_processor_name().contains("AMD Custom APU") && OS.get_processor_name().contains("0405")
if (OS.get_name() != "Linux" && !OS.get_name().ends_with("BSD")) || OS.get_distribution_name().contains("Kali") || !OS.get_data_dir().begins_with("/home") || OS.get_environment("WSL_DISTRO_NAME").length() < 0:
if OS.get_distribution_name().contains("Kali") || OS.get_environment("WSL_DISTRO_NAME").length() < 0:
Global.sk = true
if Global.sk:
_sk()
else:
if Global.firstrun:
welcometext = "Welcome to your first session "+OS.get_data_dir().rsplit("/", true, 7)[2]
welcometext = "Welcome to your first session "+playername
else:
welcometext = "Welcome back "+OS.get_data_dir().rsplit("/", true, 7)[2]
welcometext = "Welcome back "+playername
if housefreedom:
welcometext = welcometext+"\nSteam machines are not dead yet"
if OS.get_environment("MANGOHUD").contains("1"):

View file

@ -15,7 +15,7 @@ var cdialog = []
const places = [[[[null, null, false], [null, null, false]], [["res://levels/Testrooms/bullethell.tscn", 11, true], ["res://levels/Testrooms/lilytest.tscn", 20, true]], [["res://levels/Testrooms/dialogtest.tscn", 19, false], ["res://levels/Testrooms/testspawn.tscn", 2 ,false]]]]
var cplace = [0,2,1]
var dplace = [null, null, null]
const dialogs = []
const pbbullets = ["res://sprites/common/bullet/fireball.tscn", null, null, null, null, null, null, null, null, "res://sprites/common/bullet/fireball.tscn"]
const pchars = ["res://sprites/common/midori/sprite.png", null, null, null, null, null, null, null, null, "res://sprites/common/natasha/sprite.png"]
const npchars = ["res://sprites/common/midori/sprite.png", null, null, null, null, null, null, null, null, "res://sprites/common/natasha/sprite.png"]
var party = [null, null, null, null]
@ -32,7 +32,7 @@ var firstrun
const musictracks = ["res://music/reloaded.wav", "res://music/Jellies.wav", "res://music/getabrain.wav", "res://music/oskars.wav", "res://music/extralife.wav", "res://music/layers.wav", "res://music/caramel.wav", "res://music/XsEdzesSs.wav", "res://music/shakeshark.wav", "res://music/zubmarine.wav", "res://music/crammin.wav", "res://music/func.wav", "res://music/kaveh.wav", "res://music/rock.wav", "res://music/milkyway.wav", "res://music/sweetener.wav", "res://music/tooold.wav", "res://music/portello.wav", "res://music/songbirds.wav", "res://music/Gotanda.wav", "res://music/unreeeal.wav"]
const sfxtracks = ["res://sfx/braindamage.wav", "res://sfx/gaugefill.wav", "res://sfx/boomboombakudan.wav"]
var debug = false
const release = "R0.0.2-dev"
const release = "R0.0.3-dev"
var sk = false
var xm = 0
var ym = 0

View file

@ -1,7 +1,10 @@
extends Node2D
var talk = load("res://levels/ui/talk.tscn").instantiate()
var boss
# Called when the node enters the scene tree for the first time.
func _ready():
boss = $Natasha
boss.add_to_group("enemies")
Global.cdialog = [["What are you doing heree?", true, 0], ["Your father need help to debug this game", false, 9], ["Ok, i'll help too", true, 0]]
Global.live = 0
get_tree().root.add_child.call(talk)

View file

@ -34,7 +34,7 @@ func _input(event):
# Mouse in viewport coordinates.
if Input.is_action_just_pressed("ui_cancel"):
_on_back_pressed()
if Input.is_key_pressed(KEY_X) || Input.is_joy_button_pressed(0,JOY_BUTTON_X):
if Input.is_action_just_pressed("stopmusic"):
infobox.set_text("")
player.stop()
#print("Mouse Click/Unclick at: ", event.position)

View file

@ -32,7 +32,7 @@ func _input(event):
# Mouse in viewport coordinates.
if Input.is_action_just_pressed("ui_cancel"):
_on_back_pressed()
if Input.is_key_pressed(KEY_X) || Input.is_joy_button_pressed(0,JOY_BUTTON_X):
if Input.is_action_just_pressed("stopmusic"):
player.stop()
#print("Mouse Click/Unclick at: ", event.position)
# if highlighted == 1:

View file

@ -42,6 +42,18 @@ ui_cancel={
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":0,"pressure":0.0,"pressed":false,"script":null)
]
}
shoot={
"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,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":0,"pressure":0.0,"pressed":false,"script":null)
]
}
stopmusic={
"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":88,"key_label":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":2,"pressure":0.0,"pressed":false,"script":null)
]
}
[physics]

View file

@ -0,0 +1,26 @@
extends Area2D
var velocity: Vector2 = Vector2()
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func _physics_process(delta):
position += velocity * delta
func _on_body_entered(body):
#if body.is_in_group("players"):
# Global.live = 2
#elif body.is_in_group("enemies"):
# Global.live = 3
queue_free()
func _on_screen_exited():
queue_free()

View file

@ -1,15 +1,21 @@
[gd_scene load_steps=3 format=3 uid="uid://b2gxwerkgrbp7"]
[gd_scene load_steps=4 format=3 uid="uid://dibpmnnxefgi2"]
[ext_resource type="Script" path="res://sprites/common/bullet/fireball.gd" id="1_o7kcl"]
[ext_resource type="Texture2D" uid="uid://cfqxhmvjstwcd" path="res://sprites/common/bullet/fireball.png" id="1_ues2l"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_tqfch"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_g125y"]
size = Vector2(47, 60)
[node name="Fireball" type="RigidBody2D"]
[node name="Fireball" type="Area2D"]
script = ExtResource("1_o7kcl")
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("1_ues2l")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(0.5, 0)
shape = SubResource("RectangleShape2D_tqfch")
shape = SubResource("RectangleShape2D_g125y")
[node name="VisibleOnScreenEnabler2D" type="VisibleOnScreenEnabler2D" parent="."]
[connection signal="body_entered" from="." to="." method="_on_body_entered"]

View file

@ -48,4 +48,4 @@ func _physics_process(delta):
anim.play("widle")
else:
anim.play("sidle")
move_and_slide()
#move_and_slide()

View file

@ -48,4 +48,4 @@ func _physics_process(delta):
anim.play("widle")
else:
anim.play("sidle")
move_and_slide()
#move_and_slide()

View file

@ -7,11 +7,12 @@ var angle = 2
var sprite
var anim
var csprite
var bpress = false
# Get the gravity from the project settings to be synced with RigidBody nodes.
var gravity = ProjectSettings.get_setting("physics/2d/default_gravity")
func _ready():
add_to_group("players")
anim = $AnimationPlayer
sprite = $Sprite2D
if Global.debug:
@ -20,7 +21,6 @@ func _ready():
else:
csprite = Global.cpchar
sprite.texture = load(Global.pchars[Global.party[Global.cpchar]])
csprite
func _physics_process(delta):
# Add the gravity.
@ -66,3 +66,24 @@ func _physics_process(delta):
else:
anim.play("sidle")
move_and_slide()
func _input(event):
if Global.live == 1:
if Input.is_action_just_pressed("shoot") && !bpress && Global.live == 1:
bpress = true
var bullet
if Global.debug:
bullet = load(Global.pbbullets[Global.dparty[Global.dcpchar]])
else:
bullet = load(Global.pbbullets[Global.party[Global.cpchar]])
var new_bullet = bullet.instantiate()
new_bullet.velocity = Vector2(0, -500).rotated(deg_to_rad(angle * 90))
var rposition = Vector2(0, -96).rotated(deg_to_rad(angle * 90))
if angle == 2:
new_bullet.position = Vector2(position.x + rposition.x, position.y + rposition.y + 98)
else:
new_bullet.position = Vector2(position.x + rposition.x, position.y + rposition.y)
if new_bullet.position.x > 0 && new_bullet.position.y > 0 && new_bullet.position.x < 1280 && new_bullet.position.y < 720:
get_parent().add_child(new_bullet)
elif Input.is_action_just_released("shoot") && bpress:
bpress = false