moonwalker

This commit is contained in:
Page Asgardius 2024-01-20 06:58:29 -07:00
parent d3eef9dbac
commit 9dda46397e
12 changed files with 160 additions and 8 deletions

View file

@ -1,6 +1,6 @@
extends Node
var live
var live = 0
var time
var origmpos
var mousepos
@ -20,7 +20,7 @@ var gamelevel
var levelmax
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"]
const sfxtracks = ["res://sfx/braindamage.wav", "res://sfx/gaugefill.wav", "res://sfx/boomboombakudan.wav"]
var debug = false
const release = "R0.0.0-dev"
var sk = false

View file

@ -1,7 +1,13 @@
[gd_scene load_steps=2 format=3 uid="uid://cma7ddp0r4rm"]
[gd_scene load_steps=4 format=3 uid="uid://cma7ddp0r4rm"]
[ext_resource type="Texture2D" uid="uid://dursxelwwxe8u" path="res://sprites/common/placeholder/player.png" id="1_hxdyl"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_1jr1w"]
size = Vector2(20, 761)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_iptg6"]
size = Vector2(1283, 20)
[node name="Testboss" type="Node2D"]
[node name="TextureRect" type="TextureRect" parent="."]
@ -18,3 +24,27 @@ offset_right = 957.0
offset_bottom = 409.0
theme_override_font_sizes/font_size = 40
text = "Boss spawns at EBU pattern area"
[node name="StaticBody2D" type="StaticBody2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D"]
position = Vector2(-11, 361.5)
shape = SubResource("RectangleShape2D_1jr1w")
[node name="StaticBody2D2" type="StaticBody2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D2"]
position = Vector2(1293, 358)
shape = SubResource("RectangleShape2D_1jr1w")
[node name="StaticBody2D3" type="StaticBody2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D3"]
position = Vector2(641.5, -9)
shape = SubResource("RectangleShape2D_iptg6")
[node name="StaticBody2D4" type="StaticBody2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D4"]
position = Vector2(644, 731)
shape = SubResource("RectangleShape2D_iptg6")

View file

@ -1,10 +1,40 @@
[gd_scene load_steps=2 format=3 uid="uid://b5cxd2rmstnpt"]
[gd_scene load_steps=4 format=3 uid="uid://b5cxd2rmstnpt"]
[ext_resource type="Texture2D" uid="uid://kxvipok4tnuw" path="res://backgounds/wip.jpg" id="1_yw0he"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_nytv7"]
size = Vector2(20, 761)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_wkumn"]
size = Vector2(1283, 20)
[node name="Testspawn" type="Node2D"]
[node name="WIP" type="TextureRect" parent="."]
offset_right = 40.0
offset_bottom = 40.0
texture = ExtResource("1_yw0he")
[node name="StaticBody2D" type="StaticBody2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D"]
position = Vector2(-11, 361.5)
shape = SubResource("RectangleShape2D_nytv7")
[node name="StaticBody2D2" type="StaticBody2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D2"]
position = Vector2(1293, 358)
shape = SubResource("RectangleShape2D_nytv7")
[node name="StaticBody2D3" type="StaticBody2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D3"]
position = Vector2(641.5, -9)
shape = SubResource("RectangleShape2D_wkumn")
[node name="StaticBody2D4" type="StaticBody2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D4"]
position = Vector2(644, 731)
shape = SubResource("RectangleShape2D_wkumn")

View file

@ -43,10 +43,27 @@ func _ready():
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
Global.xm = 0
Global.ym = 0
var velocity = Vector2.ZERO
if Global.live == 1:
if Input.get_joy_axis(0,JOY_AXIS_LEFT_X) > 0.2 || Input.get_joy_axis(0,JOY_AXIS_LEFT_Y) > 0.2 || Input.get_joy_axis(0,JOY_AXIS_LEFT_X) < -0.2 || Input.get_joy_axis(0,JOY_AXIS_LEFT_Y) < -0.2:
Global.xm = Input.get_joy_axis(0,JOY_AXIS_LEFT_X)
Global.ym = Input.get_joy_axis(0,JOY_AXIS_LEFT_Y)
else:
if Input.is_action_pressed("ui_left"):
Global.xm = -1
if Input.is_action_pressed("ui_right"):
Global.xm = 1
if Input.is_action_pressed("ui_up"):
Global.ym = -1
if Input.is_action_pressed("ui_down"):
Global.ym = 1
velocity = (Vector2.RIGHT.rotated(rotation) * -100 * Global.xm * delta)-Vector2.UP.rotated(rotation) * -100 * Global.ym * delta
func _input(event):
if Input.is_key_pressed(KEY_ESCAPE) || Input.is_joy_button_pressed(0,JOY_BUTTON_BACK):
Global.live = 0
get_tree().root.remove_child(player)
get_tree().root.remove_child(level)
if Global.debug:

View file

@ -60,3 +60,8 @@ func _on_game_over_pressed():
func _on_gauge_fill_pressed():
player.stream = load(Global.sfxtracks[1])
player.play(0)
func _on_explosion_pressed():
player.stream = load(Global.sfxtracks[2])
player.play(0)

View file

@ -77,11 +77,11 @@ text = "Gauge Fill"
[node name="VBoxContainer2" type="VBoxContainer" parent="BoxContainer"]
layout_mode = 2
[node name="Placeholder 2" type="Button" parent="BoxContainer/VBoxContainer2"]
[node name="Explosion" type="Button" parent="BoxContainer/VBoxContainer2"]
layout_mode = 2
theme_override_font_sizes/font_size = 25
theme_override_styles/focus = SubResource("StyleBoxFlat_cprm3")
text = "Placeholder 2"
text = "Explosion"
[node name="Back" type="Button" parent="BoxContainer/VBoxContainer2"]
layout_mode = 2
@ -95,3 +95,5 @@ layout_mode = 1
[connection signal="finished" from="nebula" to="nebula" method="_on_finished"]
[connection signal="pressed" from="BoxContainer/VBoxContainer/Game Over" to="." method="_on_game_over_pressed"]
[connection signal="pressed" from="BoxContainer/VBoxContainer/Gauge Fill" to="." method="_on_gauge_fill_pressed"]
[connection signal="pressed" from="BoxContainer/VBoxContainer2/Explosion" to="." method="_on_explosion_pressed"]
[connection signal="pressed" from="BoxContainer/VBoxContainer2/Back" to="." method="_on_back_pressed"]

View file

@ -48,9 +48,11 @@ func _on_back_pressed():
func _on_testspawn_pressed():
Global.dplace = [0, 2, 1]
Global.live = 1
get_tree().change_scene_to_file("res://levels/ui/gameplay.tscn")
func _on_testboss_pressed():
Global.dplace = [0, 1, 1]
Global.live = 1
get_tree().change_scene_to_file("res://levels/ui/gameplay.tscn")

View file

@ -43,6 +43,10 @@ ui_cancel={
]
}
[physics]
2d/default_gravity_vector=Vector2(0, 0)
[rendering]
renderer/rendering_method="gl_compatibility"

BIN
sfx/boomboombakudan.wav Normal file

Binary file not shown.

View file

@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://css5w585ww5ew"
path="res://.godot/imported/boomboombakudan.wav-e838e1fd9a85c8413ee281b27dd6cf47.sample"
[deps]
source_file="res://sfx/boomboombakudan.wav"
dest_files=["res://.godot/imported/boomboombakudan.wav-e838e1fd9a85c8413ee281b27dd6cf47.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0

View file

@ -0,0 +1,36 @@
extends CharacterBody2D
const SPEED = 300.0
const JUMP_VELOCITY = -400.0
var angle = 2
# Get the gravity from the project settings to be synced with RigidBody nodes.
var gravity = ProjectSettings.get_setting("physics/2d/default_gravity")
@onready var anim := $AnimationPlayer
func _physics_process(delta):
# Add the gravity.
#var velocity = Vector2.ZERO
if Global.live == 1:
velocity = (Vector2.RIGHT.rotated(rotation) * 500 * Global.xm * delta)-Vector2.UP.rotated(rotation) * 500 * Global.ym * delta
#origmpos = get_viewport().get_mouse_position()
#if Input.get_joy_axis(0,JOY_AXIS_LEFT_Y) != 0:
# velocity = Vector2.UP.rotated(rotation) * -400 * Input.get_joy_axis(0,JOY_AXIS_LEFT_Y)
position += velocity
if Global.ym > 0.3:
angle = 2
elif Global.ym < -0.3:
angle = 0
if velocity.y != 0 || velocity.x != 0:
if angle == 0:
anim.play("nwalk")
else:
anim.play("swalk")
else:
if angle == 0:
anim.play("nidle")
else:
anim.play("sidle")
move_and_slide()

View file

@ -1,5 +1,6 @@
[gd_scene load_steps=9 format=3 uid="uid://cehe6sm8ly06u"]
[gd_scene load_steps=10 format=3 uid="uid://cehe6sm8ly06u"]
[ext_resource type="Script" path="res://sprites/common/midori/midori.gd" id="1_6vvcv"]
[ext_resource type="Texture2D" uid="uid://bc2vrf8qggvtp" path="res://sprites/common/midori/sprite.png" id="1_oqq2w"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_dj8gt"]
@ -94,6 +95,7 @@ _data = {
}
[node name="Midori" type="CharacterBody2D"]
script = ExtResource("1_6vvcv")
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("1_oqq2w")