File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed
Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -6,9 +6,12 @@ namespace KentingStation.Item;
66
77public partial class ItemDrop : Area2D
88{
9+ private const int DespawnTimer = 10000 ;
10+
911 private IItem _item ;
1012 private int _itemCount ;
1113 private Sprite2D _sprite ;
14+ private int _timestamp ;
1215
1316 // Called when the node enters the scene tree for the first time.
1417 public override void _Ready ( )
@@ -24,6 +27,9 @@ public override void _Ready()
2427 // Called every frame. 'delta' is the elapsed time since the previous frame.
2528 public override void _Process ( double delta )
2629 {
30+ _timestamp ++ ;
31+ if ( _timestamp > DespawnTimer )
32+ QueueFree ( ) ;
2733 }
2834
2935 private void OnBodyEntered ( Node2D body )
Original file line number Diff line number Diff line change 11<wpf : ResourceDictionary xml : space =" preserve" xmlns : x =" http://schemas.microsoft.com/winfx/2006/xaml" xmlns : s =" clr-namespace:System;assembly=mscorlib" xmlns : ss =" urn:shemas-jetbrains-com:settings-storage-xaml" xmlns : wpf =" http://schemas.microsoft.com/winfx/2006/xaml/presentation" >
2+ <s : Boolean x : Key =" /Default/UserDictionary/Words/=despawn/@EntryIndexedValue" >True</s : Boolean >
23 <s : Boolean x : Key =" /Default/UserDictionary/Words/=kenting/@EntryIndexedValue" >True</s : Boolean ></wpf : ResourceDictionary >
You can’t perform that action at this time.
0 commit comments