mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-07-05 01:01:16 +00:00
stuff
This commit is contained in:
parent
9e3c75ca1d
commit
2b53936f8b
6 changed files with 54 additions and 7 deletions
34
Scenes/fragola.cs
Normal file
34
Scenes/fragola.cs
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
using Godot;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
|
||||
public partial class fragola : RigidBody2D
|
||||
{
|
||||
[Signal]
|
||||
public delegate void HitEventHandler();
|
||||
|
||||
// Called when the node enters the scene tree for the first time.
|
||||
public override void _Ready()
|
||||
{
|
||||
}
|
||||
|
||||
// Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
}
|
||||
|
||||
private void _on_body_entered(Node body)
|
||||
{
|
||||
Debug.WriteLine("Collision");
|
||||
Hide();
|
||||
EmitSignal(SignalName.Hit);
|
||||
// Must be deferred as we can't change physics properties on a physics callback.
|
||||
GetNode<CollisionShape2D>("CollisionShape2D").SetDeferred(CollisionShape2D.PropertyName.Disabled, true);
|
||||
}
|
||||
private void _on_area_2d_area_entered(Area2D area)
|
||||
{
|
||||
// Replace with function body.
|
||||
Debug.WriteLine("Collision area");
|
||||
EmitSignal(SignalName.Hit);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue