Skip to content

Commit

Permalink
version Finale
Browse files Browse the repository at this point in the history
  • Loading branch information
Xelon-coder committed May 25, 2023
2 parents ba02902 + fb9472b commit 6628aef
Show file tree
Hide file tree
Showing 32 changed files with 1,127 additions and 1,075 deletions.
Binary file added .vs/ProjectEvaluation/godot_racing.metadata.v5.2
Binary file not shown.
Binary file added .vs/ProjectEvaluation/godot_racing.projects.v5.2
Binary file not shown.
Binary file added .vs/godot_racing/DesignTimeBuild/.dtbcache.v2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file added .vs/godot_racing/v17/.futdcache.v2
Binary file not shown.
Binary file added .vs/godot_racing/v17/.suo
Binary file not shown.
88 changes: 0 additions & 88 deletions IA.cs

This file was deleted.

90 changes: 76 additions & 14 deletions Mario_Kart_du_Bled.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,73 @@

public class Mario_Kart_du_Bled : Node2D
{

// Declare member variables here. Examples:
// private int a = 2;
// private string b = "text";


// Member variables

public float time = 0F;
public float best_time = 999F;
public int nb_checkpoint_passed = 0;
public int nb_mur_cogne = 0;
public bool[] all_passed = {false, false, false, false};
public float ticZoneLente;
public float nbZoneLente = 0F;

// Called when the node enters the scene tree for the first time.
public override void _Ready(){}

public int getNbCheckpoints(){
return nb_checkpoint_passed;
}
public float getTime(){
return time;
}

public float getNbZoneLente(){
return nbZoneLente;
}

public void setNbZoneLente(float t){
nbZoneLente = t;
}

public void setTime(float t)
{
time = t;
}

public void setAll_Passed(bool[] tab){
all_passed = tab;
}

public int getNbCheckpoints(){
return nb_checkpoint_passed;
}

public void setNbCheckpoints(int c){
nb_checkpoint_passed = c;
}

public void setTextPopulation(int num){
var msg = (GetNode<CanvasLayer>("HUD")).GetNode<Label>("population");
msg.Text = "Population : "+num;
msg.Show();
}

public void setTextIndividu(int num){
var msg = (GetNode<CanvasLayer>("HUD")).GetNode<Label>("individu");
msg.Text = "Individu : "+num;
msg.Show();
}



// Called every frame. 'delta' is the elapsed time since the previous frame.
// Each checkpoint (Area2D objects) must be passd trought at least once before the finish line allow the best time to be displayed
// Each checkpoint (Area2D objects) must be passed trought at least once before the finish line allow the best time to be displayed
public override void _Process(float delta)
{
time+=delta;
var msg = (GetNode<CanvasLayer>("HUD")).GetNode<Label>("time");
msg.Text = "TIME :"+time;
msg.Text = "TIME : "+time;
msg.Show();
if(!all_passed[0] && !all_passed[1] && !all_passed[2] && !all_passed[3]){
var msg2 = (GetNode<CanvasLayer>("HUD")).GetNode<Label>("nbcp");
msg2.Text = "CHECKPOINT PASSED : "+nb_checkpoint_passed;
msg2.Show();
}
}

public void _on_checkpoint1_body_entered(Node2D body)
Expand Down Expand Up @@ -114,18 +153,41 @@ public void _on_finish_line_body_entered(Node2D body)
public void _on_ZoneLente_body_entered(player body)
{
if(body.Name == "player"){
ticZoneLente = time;
body.VelocityZL();
}
}
}

public void _on_ZoneLente_body_exited(player body)
{
if(body.Name == "player"){
nbZoneLente += time - ticZoneLente;
body.VelocityInit();
nbZoneLente++;
}
}


// Pour remettre "tout" à zéro avec un nouvel individu :
public void resetAll(){
time = 0F;
nbZoneLente = 0F;
var msg = (GetNode<CanvasLayer>("HUD")).GetNode<Label>("time");
msg.Text = "TIME :"+time;
msg.Show();
for(int i = 0; i<all_passed.Length; i++){
all_passed[i] = false;
}
nb_checkpoint_passed = 0;
var msg2 = (GetNode<CanvasLayer>("HUD")).GetNode<Label>("nbcp");
msg2.Text = "CHECKPOINT PASSED :"+nb_checkpoint_passed;
msg2.Show();
}

}






159 changes: 159 additions & 0 deletions Mario_Kart_du_Bled.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
[gd_resource type="TileSet" load_steps=15 format=2]

[ext_resource path="res://Mur_int.png" type="Texture" id=1]
[ext_resource path="res://Mur_ext.png" type="Texture" id=2]

[sub_resource type="ConvexPolygonShape2D" id=10]
points = PoolVector2Array( 736, 53.3333, 0.833344, 50.8333, 0.833344, 0, 736, 0 )

[sub_resource type="ConvexPolygonShape2D" id=11]
points = PoolVector2Array( 100.833, 533.333, 2.5, 533.333, 2.5, 0, 100.833, 0 )

[sub_resource type="ConvexPolygonShape2D" id=12]
points = PoolVector2Array( 0, 532.5, 102.5, 532.5, 102.5, 582.5, 0, 582.5 )

[sub_resource type="ConvexPolygonShape2D" id=13]
points = PoolVector2Array( 20, 960, 0, 960, 0, 582.667, 20, 582.667 )

[sub_resource type="ConvexPolygonShape2D" id=14]
points = PoolVector2Array( 736, 960, 0, 960, 0, 930.167, 736, 930.167 )

[sub_resource type="ConvexPolygonShape2D" id=15]
points = PoolVector2Array( 736, 938.5, 665, 938.5, 665, 639.333, 736, 639.333 )

[sub_resource type="ConvexPolygonShape2D" id=16]
points = PoolVector2Array( 736, 590, 710.833, 590, 710.833, 56.6667, 736, 56.6667 )

[sub_resource type="ConvexPolygonShape2D" id=17]
points = PoolVector2Array( 736, 751.667, 709.167, 751.667, 709.167, 589.167, 736, 589.167 )

[sub_resource type="ConvexPolygonShape2D" id=20]
points = PoolVector2Array( 542.083, 280.278, 287.917, 280.278, 285.833, 224.028, 539.306, 224.028 )

[sub_resource type="ConvexPolygonShape2D" id=21]
points = PoolVector2Array( 508.056, 601.285, 414.306, 601.285, 414.306, 279.757, 508.056, 279.757 )

[sub_resource type="ConvexPolygonShape2D" id=22]
points = PoolVector2Array( 492.778, 744.688, 415.694, 744.688, 415.694, 598.854, 492.778, 598.854 )

[sub_resource type="ConvexPolygonShape2D" id=23]
points = PoolVector2Array( 449.028, 746.771, 256.667, 746.771, 256.667, 672.465, 449.028, 672.465 )

[resource]
resource_name = "MUR_MK"
1/name = "Mur_ext.png 1"
1/texture = ExtResource( 2 )
1/tex_offset = Vector2( 0, 0 )
1/modulate = Color( 1, 1, 1, 1 )
1/region = Rect2( 160, 416, 32, 32 )
1/tile_mode = 0
1/occluder_offset = Vector2( 0, 0 )
1/navigation_offset = Vector2( 0, 0 )
1/shape_offset = Vector2( 0, 0 )
1/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
1/shape_one_way = false
1/shape_one_way_margin = 0.0
1/shapes = [ ]
1/z_index = 0
2/name = "Mur_ext.png 2"
2/texture = ExtResource( 2 )
2/tex_offset = Vector2( 0, 0 )
2/modulate = Color( 1, 1, 1, 1 )
2/region = Rect2( 0, 0, 736, 960 )
2/tile_mode = 0
2/occluder_offset = Vector2( 0, 0 )
2/navigation_offset = Vector2( 0, 0 )
2/shape_offset = Vector2( 0, 0 )
2/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
2/shape = SubResource( 10 )
2/shape_one_way = false
2/shape_one_way_margin = 1.0
2/shapes = [ {
"autotile_coord": Vector2( 0, 0 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 10 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 0, 0 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 11 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 0, 0 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 12 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 0, 0 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 13 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 0, 0 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 14 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 0, 0 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 15 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 0, 0 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 16 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 0, 0 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 17 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
} ]
2/z_index = 0
3/name = "Mur_int.png 3"
3/texture = ExtResource( 1 )
3/tex_offset = Vector2( 0, 0 )
3/modulate = Color( 1, 1, 1, 1 )
3/region = Rect2( 0, 0, 736, 960 )
3/tile_mode = 0
3/occluder_offset = Vector2( 0, 0 )
3/navigation_offset = Vector2( 0, 0 )
3/shape_offset = Vector2( 0, 0 )
3/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
3/shape = SubResource( 20 )
3/shape_one_way = false
3/shape_one_way_margin = 1.0
3/shapes = [ {
"autotile_coord": Vector2( 0, 0 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 20 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 0, 0 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 21 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 0, 0 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 22 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 0, 0 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 23 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
} ]
3/z_index = 0
Loading

0 comments on commit 6628aef

Please sign in to comment.