Compare commits

...

4 Commits

9 changed files with 159 additions and 32 deletions

View File

@ -1,8 +1,10 @@
[gd_scene load_steps=5 format=2] [gd_scene load_steps=7 format=2]
[ext_resource path="res://icon.png" type="Texture" id=1] [ext_resource path="res://icon.png" type="Texture" id=1]
[ext_resource path="res://Characters/Player.tscn" type="PackedScene" id=2] [ext_resource path="res://Characters/Player.tscn" type="PackedScene" id=2]
[ext_resource path="res://Scenes/BattleScene.gd" type="Script" id=3] [ext_resource path="res://Scenes/BattleScene.gd" type="Script" id=3]
[ext_resource path="res://UI/CardView.tscn" type="PackedScene" id=4]
[ext_resource path="res://UI/DiceView.tscn" type="PackedScene" id=5]
[sub_resource type="TileSet" id=1] [sub_resource type="TileSet" id=1]
0/name = "icon.png 0" 0/name = "icon.png 0"
@ -33,3 +35,24 @@ format = 1
tile_data = PoolIntArray( 65540, 0, 0, 131074, 0, 0, 131075, 0, 0, 131076, 0, 0, 131077, 0, 0, 131078, 0, 0, 196610, 0, 0, 196611, 0, 0, 196612, 0, 0, 196613, 0, 0, 196614, 0, 0, 262144, 0, 0, 262145, 0, 0, 262146, 0, 0, 262147, 0, 0, 262148, 0, 0, 262149, 0, 0, 262150, 0, 0, 327681, 0, 0, 327682, 0, 0, 327683, 0, 0, 327684, 0, 0, 327685, 0, 0, 327686, 0, 0, 393217, 0, 0, 393218, 0, 0, 393219, 0, 0, 393220, 0, 0, 393221, 0, 0, 393222, 0, 0, 458754, 0, 0, 458755, 0, 0, 458756, 0, 0, 458757, 0, 0, 524291, 0, 0, 524292, 0, 0 ) tile_data = PoolIntArray( 65540, 0, 0, 131074, 0, 0, 131075, 0, 0, 131076, 0, 0, 131077, 0, 0, 131078, 0, 0, 196610, 0, 0, 196611, 0, 0, 196612, 0, 0, 196613, 0, 0, 196614, 0, 0, 262144, 0, 0, 262145, 0, 0, 262146, 0, 0, 262147, 0, 0, 262148, 0, 0, 262149, 0, 0, 262150, 0, 0, 327681, 0, 0, 327682, 0, 0, 327683, 0, 0, 327684, 0, 0, 327685, 0, 0, 327686, 0, 0, 393217, 0, 0, 393218, 0, 0, 393219, 0, 0, 393220, 0, 0, 393221, 0, 0, 393222, 0, 0, 458754, 0, 0, 458755, 0, 0, 458756, 0, 0, 458757, 0, 0, 524291, 0, 0, 524292, 0, 0 )
[node name="Player" parent="." instance=ExtResource( 2 )] [node name="Player" parent="." instance=ExtResource( 2 )]
[node name="Camera2D" type="Camera2D" parent="Player"]
offset = Vector2( 0, 200 )
current = true
drag_margin_h_enabled = true
drag_margin_v_enabled = true
drag_margin_left = 0.3
drag_margin_top = 0.05
drag_margin_right = 0.3
editor_draw_drag_margin = true
[node name="CanvasLayer" type="CanvasLayer" parent="."]
[node name="CardView" parent="CanvasLayer" instance=ExtResource( 4 )]
margin_top = 367.0
margin_right = -314.0
[node name="DiceView" parent="CanvasLayer" instance=ExtResource( 5 )]
margin_left = 966.0
margin_top = 367.0
grow_horizontal = 0

View File

@ -19,6 +19,7 @@ var addition_dice_amount : int setget _set_addition_dice
func _set_addition_dice(new_amount): func _set_addition_dice(new_amount):
addition_dice_amount = new_amount
$VBox/AutoGrid/InputDice0/Number.text = String(new_amount) $VBox/AutoGrid/InputDice0/Number.text = String(new_amount)

View File

@ -1,7 +1,7 @@
[gd_scene load_steps=12 format=2] [gd_scene load_steps=12 format=2]
[ext_resource path="res://UI/Card.gd" type="Script" id=1] [ext_resource path="res://UI/Card.gd" type="Script" id=1]
[ext_resource path="res://Assets/CardDB/Broadsword.tres" type="Resource" id=2] [ext_resource path="res://Assets/CardDB/Default.tres" type="Resource" id=2]
[ext_resource path="res://Assets/Metropolis-font/Metropolis-Bold.ttf" type="DynamicFontData" id=3] [ext_resource path="res://Assets/Metropolis-font/Metropolis-Bold.ttf" type="DynamicFontData" id=3]
[ext_resource path="res://Assets/DiceInput.png" type="Texture" id=4] [ext_resource path="res://Assets/DiceInput.png" type="Texture" id=4]
[ext_resource path="res://AutoGridContainer - Full Version/AutoGridContainer.tscn" type="PackedScene" id=5] [ext_resource path="res://AutoGridContainer - Full Version/AutoGridContainer.tscn" type="PackedScene" id=5]
@ -35,8 +35,6 @@ font_data = ExtResource( 3 )
[node name="Card" type="Control"] [node name="Card" type="Control"]
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
margin_right = -741.0
margin_bottom = -227.0
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
script = ExtResource( 1 ) script = ExtResource( 1 )
@ -56,23 +54,24 @@ margin_right = -10.0
margin_bottom = -10.0 margin_bottom = -10.0
[node name="Name" type="Label" parent="VBox"] [node name="Name" type="Label" parent="VBox"]
margin_right = 263.0 margin_right = 1260.0
margin_bottom = 31.0 margin_bottom = 31.0
custom_fonts/font = SubResource( 2 ) custom_fonts/font = SubResource( 2 )
text = "Broadsword" text = "Default"
align = 1 align = 1
autowrap = true autowrap = true
[node name="AutoGrid" parent="VBox" instance=ExtResource( 5 )] [node name="AutoGrid" parent="VBox" instance=ExtResource( 5 )]
margin_top = 35.0 margin_top = 35.0
margin_right = 263.0 margin_right = 1260.0
margin_bottom = 256.0 margin_bottom = 606.0
[node name="InputDice0" type="TextureRect" parent="VBox/AutoGrid"] [node name="InputDice0" type="TextureRect" parent="VBox/AutoGrid"]
margin_left = 9.0 margin_left = 42.0
margin_right = 209.0 margin_top = 5.0
margin_bottom = 200.0 margin_right = 192.0
rect_min_size = Vector2( 100, 100 ) margin_bottom = 155.0
rect_min_size = Vector2( 75, 75 )
size_flags_horizontal = 3 size_flags_horizontal = 3
size_flags_vertical = 3 size_flags_vertical = 3
texture = ExtResource( 4 ) texture = ExtResource( 4 )
@ -90,13 +89,12 @@ align = 1
valign = 1 valign = 1
[node name="Description" type="Label" parent="VBox"] [node name="Description" type="Label" parent="VBox"]
margin_top = 260.0 margin_top = 610.0
margin_right = 263.0 margin_right = 1260.0
margin_bottom = 353.0 margin_bottom = 700.0
rect_min_size = Vector2( 0, 90 ) rect_min_size = Vector2( 0, 90 )
custom_fonts/font = SubResource( 5 ) custom_fonts/font = SubResource( 5 )
text = "Does damage equal to the sum of both dice to all enemies text = "Default Description"
Range: 2 spaces"
align = 1 align = 1
valign = 1 valign = 1
autowrap = true autowrap = true

View File

@ -1,34 +1,47 @@
[gd_scene load_steps=2 format=2] [gd_scene load_steps=5 format=2]
[ext_resource path="res://UI/Card.tscn" type="PackedScene" id=1] [ext_resource path="res://UI/Card.tscn" type="PackedScene" id=1]
[ext_resource path="res://Assets/CardDB/Sprint.tres" type="Resource" id=2]
[ext_resource path="res://Assets/CardDB/Poisonous apple.tres" type="Resource" id=3]
[ext_resource path="res://Assets/CardDB/Broadsword.tres" type="Resource" id=4]
[node name="CardView" type="Control"] [node name="CardView" type="Control"]
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
margin_top = 277.0
margin_right = -252.0
[node name="HBox" type="HBoxContainer" parent="."] [node name="Margin" type="MarginContainer" parent="."]
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
margin_left = 30.0
margin_top = 30.0
margin_right = -30.0
margin_bottom = -30.0
[node name="HBox" type="HBoxContainer" parent="Margin"]
margin_right = 1220.0
margin_bottom = 660.0
rect_min_size = Vector2( 0, 300 )
custom_constants/separation = 50 custom_constants/separation = 50
[node name="Card1" parent="HBox" instance=ExtResource( 1 )] [node name="Card1" parent="Margin/HBox" instance=ExtResource( 1 )]
anchor_right = 0.0 anchor_right = 0.0
anchor_bottom = 0.0 anchor_bottom = 0.0
margin_right = 224.0 margin_right = 373.0
margin_bottom = 323.0 margin_bottom = 660.0
card_info = ExtResource( 2 )
[node name="Card2" parent="HBox" instance=ExtResource( 1 )] [node name="Card2" parent="Margin/HBox" instance=ExtResource( 1 )]
anchor_right = 0.0 anchor_right = 0.0
anchor_bottom = 0.0 anchor_bottom = 0.0
margin_left = 274.0 margin_left = 423.0
margin_right = 498.0 margin_right = 796.0
margin_bottom = 323.0 margin_bottom = 660.0
card_info = ExtResource( 4 )
[node name="Card3" parent="HBox" instance=ExtResource( 1 )] [node name="Card3" parent="Margin/HBox" instance=ExtResource( 1 )]
anchor_right = 0.0 anchor_right = 0.0
anchor_bottom = 0.0 anchor_bottom = 0.0
margin_left = 548.0 margin_left = 846.0
margin_right = 772.0 margin_right = 1220.0
margin_bottom = 323.0 margin_bottom = 660.0
card_info = ExtResource( 3 )

16
UI/Dice.gd Normal file
View File

@ -0,0 +1,16 @@
tool
extends Control
const dice_image_string = "res://Assets/Dice/Dice%s.png"
export (int, 1, 6) var dice_value : int setget _set_dice_value
func _set_dice_value(new_value):
dice_value = new_value
self.texture = load(dice_image_string % new_value)
func _ready():
randomize()
self.dice_value = round(rand_range(0.5, 6.49999999))

12
UI/Dice.tscn Normal file
View File

@ -0,0 +1,12 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://UI/Dice.gd" type="Script" id=2]
[node name="Dice" type="TextureRect"]
margin_right = 100.0
margin_bottom = 100.0
size_flags_horizontal = 3
size_flags_vertical = 3
expand = true
stretch_mode = 6
script = ExtResource( 2 )

17
UI/DiceView.gd Normal file
View File

@ -0,0 +1,17 @@
extends Control
const dice = preload("res://UI/Dice.tscn")
var current_dice = []
func roll_dice(specific_value : int = 0):
# make a new dice instance and add it to the grid container
var new_dice = dice.instance()
$Margin/AutoGrid.add_child(new_dice)
# if a specifc dice choosen, make new dice that type
if specific_value in [1, 2, 3, 4, 5, 6]:
new_dice.dice_value = specific_value
# add the current dice to the list of dice
current_dice.append(new_dice)

40
UI/DiceView.tscn Normal file
View File

@ -0,0 +1,40 @@
[gd_scene load_steps=6 format=2]
[ext_resource path="res://AutoGridContainer - Full Version/AutoGridContainer.tscn" type="PackedScene" id=1]
[ext_resource path="res://UI/DiceView.gd" type="Script" id=2]
[ext_resource path="res://UI/Dice.tscn" type="PackedScene" id=3]
[ext_resource path="res://Assets/Dice/Dice6.png" type="Texture" id=4]
[ext_resource path="res://Assets/Dice/Dice1.png" type="Texture" id=5]
[node name="DiceView" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
script = ExtResource( 2 )
[node name="Margin" type="MarginContainer" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 30.0
margin_top = 30.0
margin_right = -30.0
margin_bottom = -30.0
[node name="AutoGrid" parent="Margin" instance=ExtResource( 1 )]
margin_right = 1220.0
margin_bottom = 660.0
[node name="Dice" parent="Margin/AutoGrid" instance=ExtResource( 3 )]
texture = ExtResource( 5 )
dice_value = 1
[node name="Dice2" parent="Margin/AutoGrid" instance=ExtResource( 3 )]
texture = ExtResource( 5 )
dice_value = 1
[node name="Dice3" parent="Margin/AutoGrid" instance=ExtResource( 3 )]
texture = ExtResource( 5 )
dice_value = 1
[node name="Dice4" parent="Margin/AutoGrid" instance=ExtResource( 3 )]
texture = ExtResource( 4 )
dice_value = 6

View File

@ -23,6 +23,13 @@ _global_script_class_icons={
config/name="Quit Rolling Around" config/name="Quit Rolling Around"
config/icon="res://icon.png" config/icon="res://icon.png"
[display]
window/size/width=1280
window/size/height=720
window/stretch/mode="2d"
window/stretch/aspect="keep_width"
[physics] [physics]
common/enable_pause_aware_picking=true common/enable_pause_aware_picking=true