Skip to content
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

Shop #137

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Shop #137

wants to merge 12 commits into from

Conversation

JonaLam
Copy link
Collaborator

@JonaLam JonaLam commented Nov 5, 2024

Description

Added a shop system
new shop scene which sells item

Related issue(s)

#119

List of changes

  • Changed the shop scene into something.
  • Added shop item class which we place in the scene to sell the diffrent items

Additional notes

How items are priced is not implemented in any meaningful way other than a set number on each of the shop items
the pool of items the shop can sell is just strings to their position in the files
The inventory might make you unable to click anything, to fix you can make the inventory be a child of the inventorynode rather than the tree

@Turtyo Turtyo linked an issue Nov 5, 2024 that may be closed by this pull request
@Turtyo
Copy link
Collaborator

Turtyo commented Nov 5, 2024

I think we should remove the test on the naming convention, it's more bothersome than anything else

Copy link
Collaborator

@Turtyo Turtyo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking the scene inside the game, the overlay on the top right is not correctly on screen. The proceed button should automatically open the map, or the map movement should be set to allowed directly when entering the shop (I think the second option is better)

Opening the inventory still prevents it from interacting with anything else or being closed, as mentioned in #136
That makes it impossible for me to add gold and thus to test that buying things in the shop actually work, how did you test that btw ?

Comment on lines 1 to 37
[gd_scene load_steps=8 format=3 uid="uid://b8hbst1klk5ng"]

[ext_resource type="PackedScene" uid="uid://bam77cwf4emyr" path="res://#Scenes/TopBarOverlay.tscn" id="1_7gwvp"]
[ext_resource type="Script" path="res://#Scenes/SceneScripts/ShopScene.gd" id="1_u1m6k"]
[ext_resource type="Resource" uid="uid://uv2rili0xf3x" path="res://Cards/Resource/Card_Damage_EVERYTHING.tres" id="2_u60ec"]
[ext_resource type="Texture2D" uid="uid://bo0j1ve4n2ni7" path="res://Art/Background/Shop_Background.png" id="3_6osfu"]
[ext_resource type="Resource" uid="uid://d4lugn62mmlep" path="res://Cards/Resource/Card_DrawCards.tres" id="3_trwis"]
[ext_resource type="PackedScene" uid="uid://cdt4k2reymt2i" path="res://Shop/shop_item.tscn" id="4_bbct0"]
[ext_resource type="Resource" uid="uid://0x385c3nuq8f" path="res://Cards/Resource/Card_DamageAllEnemies.tres" id="4_e4vp7"]

[node name="Control" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_u1m6k")
cardPool = Array[Object]([ExtResource("2_u60ec"), ExtResource("3_trwis"), ExtResource("4_e4vp7")])

[node name="TopBarOverlay" parent="." instance=ExtResource("1_7gwvp")]
layout_mode = 1

[node name="TextureRect" type="TextureRect" parent="."]
layout_mode = 0
offset_left = 20.0
offset_top = 16.0
offset_right = 1068.0
offset_bottom = 1064.0
texture = ExtResource("3_6osfu")
expand_mode = 1

[node name="ShopItem" parent="." instance=ExtResource("4_bbct0")]
offset_left = 216.0
offset_top = 252.0
offset_right = 216.0
offset_bottom = 252.0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure that a .tmp file needs to be pushed

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a good way to revert this?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's a Stackoverflow on how to revert the file: https://stackoverflow.com/questions/18357511/git-remove-committed-file-after-push

But honestly... it's a .tmp file so I feel you could just delete this and push up that change. But I would sanity check that the shop scene is still working first after you delete and before you push up that change!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can just delete the file and push the change, no one else uses the tmp file (as ty said, just check that it still works correctly before pushing, but I removed tmp file in another PR and it worked fine)

Managers/ShopManager.gd Outdated Show resolved Hide resolved
Cards/CardWorld.gd Show resolved Hide resolved
Managers/ShopManager.gd Show resolved Hide resolved
Shop/shop_item_consumable.gd Outdated Show resolved Hide resolved
Shop/ShopItemCard.gd Outdated Show resolved Hide resolved
Shop/shop_item_relic.gd Outdated Show resolved Hide resolved
Shop/shop_item_torch.gd Show resolved Hide resolved
Comment on lines 14 to 19
for i in amount:
var instance : TextureRect = torchTexture.instantiate()
heldTorches.append(instance)
instance.position = startPos
startPos += Vector2.RIGHT * 5
add_child(instance)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a little comment to explain what you are doing here would be good

#Scenes/Events/shop/CardRemoval.gd Outdated Show resolved Hide resolved
@Tysterman74
Copy link
Collaborator

Also, if we're removing out items and consumables should we have this PR updated to remove those sections?

Tysterman74
Tysterman74 previously approved these changes Dec 10, 2024
@Turtyo
Copy link
Collaborator

Turtyo commented Dec 14, 2024

Yes, since we won't be using items and consumables, I would comment out / disable the items in this PR; the shop is still useful to buy torches and cards

Copy link
Collaborator

@Turtyo Turtyo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
image
The overlay is not positioned correctly.

The proceed button doesn't open the map.

@JonaLam
Copy link
Collaborator Author

JonaLam commented Dec 19, 2024

I removed the items and consumables from the shop, they're just not there, but I don't really see the point of deleting the files so I think it's fine to let them be there.

I also removed the proceed button and made it so you can move by opening the map.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shop event
3 participants