Csharp rewrite (#4)
* Implement BeamComponent in C# and enhance marketplace button functionality * Add core game components including ConfigFileHandler, GameManager, SaveSystem, and UIManager * cleanup * Add new components: CanPickUpComponent, CollapsableComponent, DestroyableComponent, EffectInflictorComponent, StatusEffectComponent, and StatusEffectDataResource * Add new components: EnemyDeathComponent, EnemyWaveTriggerComponent, and ExitDoorComponent * Add new components: ExplosiveComponent, FadeAwayComponent, FireEffectComponent, FlipComponent, GravityMotionComponent, LaunchComponent, and update PlatformMovement with LastDirection property * Add new components: HealComponent, HitComponent, HomingMissileMotionComponent, LeverComponent, and TriggerLeverComponent * Refactor GameManager session state handling and add new components: CanBeLaunchedComponent, IceEffectComponent, JumpPadComponent, KillPlayerOutOfScreenComponent, KnockbackComponent, LifetimeComponent, MagneticSkillComponent, OutOfScreenComponent, PeriodicShootingComponent, PlayerDeathComponent, ProgressiveDamageComponent, ProjectileComponent, ProjectileInitComponent, RequirementComponent, ScoreComponent, ShipMovementComponent, ShipShooterComponent, and SideToSideMovementComponent * Add new components: CannotStompComponent, SkillUnlockedComponent, SpaceshipEnterComponent, SpaceshipExitComponent, SpinComponent, StompDamageComponent, StraightMotionComponent, TerrainHitFx, TooltipComponent, TrailComponent, and UnlockOnRequirementComponent * Add new components: BrickThrowComponent, BulletComponent, CageComponent, ChaseLevelComponent, CleanupComponent, and ThrowInputResource classes; implement game saving and loading logic in SaveSystem * Add audio settings management and platform movement component * Add ChargeProgressBar, Credits, and GameOverScreen components for UI management * Add UID files for ConfigFileHandler, GameManager, SaveSystem, and UIManager components * Add README.md file with game description and features; include project license and contribution guidelines * Add Hud component for UI management; display health, coins, and lives * Add MainMenu and Marketplace components; implement game management and skill unlocking features * Add PauseMenu, SettingsMenu, and SkillButton components; enhance game management and UI functionality
This commit is contained in:
@@ -13,7 +13,6 @@ extends Node
|
||||
|
||||
@onready var game_manager: GM = $"/root/GameManager"
|
||||
|
||||
|
||||
var unlock_buttons: Array[Button] = []
|
||||
var skill_buttons: Array[SkillButton] = []
|
||||
|
||||
@@ -36,6 +35,14 @@ func _ready() -> void:
|
||||
|
||||
skill_unlocker.skill_unlocked.connect(on_skill_unlocked)
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
for btn in skill_buttons:
|
||||
if not btn.skill_data:
|
||||
continue
|
||||
if btn.skill_data.is_active:
|
||||
btn.activate()
|
||||
else:
|
||||
btn.deactivate()
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
if event.is_action_pressed("show_marketplace"):
|
||||
@@ -53,7 +60,6 @@ func get_button_text(skill: SkillData) -> String:
|
||||
return tr(skill.name) + " " + str(skill.cost)
|
||||
|
||||
|
||||
|
||||
func create_upgrade_button(skill: SkillData) -> void:
|
||||
var button := marketplace_button.instantiate() as MarketplaceButton
|
||||
button.text = get_button_text(skill)
|
||||
@@ -102,26 +108,19 @@ func _on_button_pressed(skill: SkillData) -> void:
|
||||
|
||||
|
||||
func on_skill_unlocked(skill: SkillData) -> void:
|
||||
# need to fix this method
|
||||
if not skill:
|
||||
return
|
||||
if skill_buttons.size() == 0:
|
||||
create_skill_button(skill)
|
||||
|
||||
for button in skill_buttons:
|
||||
if button.skill_data.is_active:
|
||||
button.activate()
|
||||
else:
|
||||
button.deactivate()
|
||||
for btn in skill_buttons:
|
||||
if btn.skill_data and btn.skill_data.name == skill.name:
|
||||
return
|
||||
|
||||
create_skill_button(skill)
|
||||
|
||||
|
||||
func on_skill_button_pressed(button: SkillButton) -> void:
|
||||
if not skill_unlocker or not button.skill_data:
|
||||
return
|
||||
|
||||
skill_unlocker.skill_manager.toggle_skill_activation(button.skill_data)
|
||||
button.activate()
|
||||
for other_button in skill_buttons:
|
||||
if other_button != button:
|
||||
other_button.deactivate()
|
||||
|
||||
|
Reference in New Issue
Block a user