-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
249 additions
and
5 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
[remap] | ||
|
||
importer="texture" | ||
type="StreamTexture" | ||
path="res://.import/menu.png-507092a63be01007fcca0624aab4189b.stex" | ||
metadata={ | ||
"vram_texture": false | ||
} | ||
|
||
[deps] | ||
|
||
source_file="res://assets/menu.png" | ||
dest_files=[ "res://.import/menu.png-507092a63be01007fcca0624aab4189b.stex" ] | ||
|
||
[params] | ||
|
||
compress/mode=0 | ||
compress/lossy_quality=0.7 | ||
compress/hdr_mode=0 | ||
compress/bptc_ldr=0 | ||
compress/normal_map=0 | ||
flags/repeat=0 | ||
flags/filter=true | ||
flags/mipmaps=false | ||
flags/anisotropic=false | ||
flags/srgb=2 | ||
process/fix_alpha_border=true | ||
process/premult_alpha=false | ||
process/HDR_as_SRGB=false | ||
process/invert_color=false | ||
stream=false | ||
size_limit=0 | ||
detect_3d=true | ||
svg/scale=1.0 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
[remap] | ||
|
||
importer="texture" | ||
type="StreamTexture" | ||
path="res://.import/title.png-f520a0d529e74edf0d3ba77895c4527c.stex" | ||
metadata={ | ||
"vram_texture": false | ||
} | ||
|
||
[deps] | ||
|
||
source_file="res://assets/title.png" | ||
dest_files=[ "res://.import/title.png-f520a0d529e74edf0d3ba77895c4527c.stex" ] | ||
|
||
[params] | ||
|
||
compress/mode=0 | ||
compress/lossy_quality=0.7 | ||
compress/hdr_mode=0 | ||
compress/bptc_ldr=0 | ||
compress/normal_map=0 | ||
flags/repeat=0 | ||
flags/filter=true | ||
flags/mipmaps=false | ||
flags/anisotropic=false | ||
flags/srgb=2 | ||
process/fix_alpha_border=true | ||
process/premult_alpha=false | ||
process/HDR_as_SRGB=false | ||
process/invert_color=false | ||
stream=false | ||
size_limit=0 | ||
detect_3d=true | ||
svg/scale=1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[remap] | ||
|
||
importer="ogg_vorbis" | ||
type="AudioStreamOGGVorbis" | ||
path="res://.import/music.ogg-4e39d6369ac4db9d479436fd6d94c7d1.oggstr" | ||
|
||
[deps] | ||
|
||
source_file="res://music/music.ogg" | ||
dest_files=[ "res://.import/music.ogg-4e39d6369ac4db9d479436fd6d94c7d1.oggstr" ] | ||
|
||
[params] | ||
|
||
loop=true | ||
loop_offset=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
extends Node2D | ||
|
||
signal selected_item | ||
|
||
|
||
var cur_pos = 0 | ||
var nxt_pos = 0 | ||
var max_pos = 0 | ||
var items = [] | ||
var unselectable_items = [] | ||
func _ready(): | ||
print( game.gamestate ) | ||
items = get_children() | ||
for idx in range( 1, items.size() ): | ||
items[idx].modulate.a = 0.3#set_opacity( 0.3 ) | ||
max_pos = items.size() - 1 | ||
|
||
func set_active( v ): | ||
if v: set_physics_process( true ) | ||
else: set_physics_process( false ) | ||
|
||
func set_unselectable_item( no ): | ||
items[no].modulate.a = 0.1#set_opacity( 0.1 ) | ||
unselectable_items.append( no ) | ||
|
||
func _physics_process(delta): | ||
if Input.is_action_just_pressed( "btn_action" ): | ||
#SoundManager.Play("inter_confirm") | ||
emit_signal( "selected_item", cur_pos ) | ||
set_physics_process( false ) | ||
return | ||
if Input.is_action_just_pressed( "btn_down" ): | ||
if unselectable_items.find( nxt_pos + 1 ) != -1: | ||
if nxt_pos + 2 <= max_pos: | ||
nxt_pos += 2 | ||
else: | ||
nxt_pos += 1 | ||
elif Input.is_action_just_pressed( "btn_up" ): | ||
if unselectable_items.find( nxt_pos - 1 ) != -1: | ||
if nxt_pos - 2 >= 0: | ||
nxt_pos -= 2 | ||
else: | ||
nxt_pos -= 1 | ||
|
||
if nxt_pos < 0: nxt_pos = 0 | ||
elif nxt_pos > max_pos: nxt_pos = max_pos | ||
|
||
if nxt_pos != cur_pos: | ||
cur_pos = nxt_pos | ||
_update_pos( cur_pos ) | ||
|
||
func _update_pos( pos ): | ||
for idx in range( items.size() ): | ||
if idx == pos: | ||
items[idx].modulate.a = 1#set_opacity( 1 ) | ||
else: | ||
if unselectable_items.find( idx ) == -1: | ||
items[idx].modulate.a = 0.3#set_opacity( 0.3 ) | ||
else: | ||
items[idx].modulate.a = 0.1#set_opacity( 0.1 ) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[gd_scene load_steps=2 format=2] | ||
|
||
[ext_resource path="res://scenes/start_menu/menu.gd" type="Script" id=1] | ||
|
||
[node name="menu" type="Node2D"] | ||
script = ExtResource( 1 ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
extends "res://scenes/scene.gd" | ||
|
||
var nxt_level = "res://scenes/scene_china.tscn" | ||
|
||
func _ready(): | ||
#if game.gamestate.cur_level.empty(): | ||
# $menu.unselectable_items.append( 1 ) | ||
#game.play_music( 2 ) | ||
pass | ||
|
||
func _on_menu_selected_item( itemno ): | ||
match itemno: | ||
0: | ||
# 1P vs CPU | ||
print("player vs cpu") | ||
game.set_initial_gamestate() | ||
game.set_game_mode(game.MODE_1PVSCPU) | ||
emit_signal( "finished_level", nxt_level ) | ||
1: | ||
# 1P vs 1P | ||
print("player vs player") | ||
game.set_initial_gamestate() | ||
game.set_game_mode(game.MODE_1PVS2P) | ||
emit_signal( "finished_level", nxt_level ) | ||
2: | ||
# CPU vs CPU | ||
print("cpu vs cpu") | ||
game.set_initial_gamestate() | ||
game.set_game_mode(game.MODE_CPUVSCPU) | ||
emit_signal( "finished_level", nxt_level ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
[gd_scene load_steps=6 format=2] | ||
|
||
[ext_resource path="res://scenes/start_menu/start_menu.gd" type="Script" id=1] | ||
[ext_resource path="res://assets/china-background.png" type="Texture" id=2] | ||
[ext_resource path="res://scenes/start_menu/menu.tscn" type="PackedScene" id=3] | ||
[ext_resource path="res://assets/menu.png" type="Texture" id=4] | ||
[ext_resource path="res://assets/title.png" type="Texture" id=5] | ||
|
||
[node name="start_menu" type="Node2D"] | ||
script = ExtResource( 1 ) | ||
|
||
[node name="background" type="Sprite" parent="."] | ||
texture = ExtResource( 2 ) | ||
offset = Vector2( 160, 100 ) | ||
|
||
[node name="menu" parent="." instance=ExtResource( 3 )] | ||
position = Vector2( -1, 0 ) | ||
|
||
[node name="player_vs_cpu" type="Sprite" parent="menu"] | ||
position = Vector2( 158, 103 ) | ||
texture = ExtResource( 4 ) | ||
region_enabled = true | ||
region_rect = Rect2( 24, 59, 109, 27 ) | ||
|
||
[node name="player_vs_player" type="Sprite" parent="menu"] | ||
position = Vector2( 158, 135 ) | ||
texture = ExtResource( 4 ) | ||
region_enabled = true | ||
region_rect = Rect2( 32, 91, 96, 21 ) | ||
|
||
[node name="cpu_vs_cpu" type="Sprite" parent="menu"] | ||
position = Vector2( 159, 164 ) | ||
texture = ExtResource( 4 ) | ||
region_enabled = true | ||
region_rect = Rect2( 26, 118, 107, 23 ) | ||
|
||
[node name="title" type="Sprite" parent="."] | ||
texture = ExtResource( 5 ) | ||
offset = Vector2( 160, 16 ) | ||
[connection signal="selected_item" from="menu" to="." method="_on_menu_selected_item"] |
Binary file not shown.