diff options
Diffstat (limited to 'luevano/test.html')
-rw-r--r-- | luevano/test.html | 176 |
1 files changed, 0 insertions, 176 deletions
diff --git a/luevano/test.html b/luevano/test.html deleted file mode 100644 index 3c60657..0000000 --- a/luevano/test.html +++ /dev/null @@ -1,176 +0,0 @@ -<!DOCTYPE html> -<html class="theme-dark" lang="en"> - <head> - <base href="https://static.luevano.xyz/"> - <meta charset="utf-8"> - <meta name="viewport" content="width=device-width, initial-scale=1"> - <title>Test page -- Luévano's Site</title> - <meta name="description" content="Test page."/> - <link rel="alternate" type="application/rss+xml" href="https://blog.luevano.xyz/rss.xml" title="Luévano's Blog RSS"> - <link rel="alternate" type="application/rss+xml" href="https://art.luevano.xyz/rss.xml" title="Luévano's Art RSS"> - <link rel="icon" href="images/icons/favicon.ico"> - - <!-- general style --> - <link rel="stylesheet" type="text/css" href="css/style.css"> - <link rel="stylesheet" type="text/css" href="fork-awesome/css/fork-awesome.min.css"> - <link rel="stylesheet" type="text/css" href="font-awesome/css/all.min.css"> - - <!-- highlight support for code blocks --> - <script type="text/javascript" src="hl/highlight.min.js"></script> - <!-- Specific to GDScript --> - <script type="text/javascript" src="hl/languages/gdscript.min.js"></script> - <script type="text/javascript"> - hljs.initHighlightingOnLoad(); - // hljs.initLineNumbersOnLoad(); - </script> - - <!-- theme related --> - <script type="text/javascript" src="scripts/theme.js"></script> - <link id="theme-css" rel="stylesheet" type="text/css" href="css/theme.css"> - <link id="code-theme-css" rel="stylesheet" type="text/css" href="hl/styles/nord.min.css"> - </head> - - <body> - <header> - <nav> - <ul> - <li> - <a href="https://luevano.xyz/"><i class="fas fa-home" alt="Home"></i><span>Home</span></a> - </li> - - <li> - <a href="https://blog.luevano.xyz/"><i class="fas fa-book-open" alt="Blog"></i><span>Blog</span></a> - </li> - - <li> - <a href="https://art.luevano.xyz/"><i class="fas fa-paint-brush" alt="Art"></i><span>Art</span></a> - </li> - - <li><i class="fab fa-git" alt="Git"></i><span>Git</span> - <ul> - <li><a href="https://git.luevano.xyz/" target="_blank"><i class="fab fa-git-alt" alt="Git-alt"></i></a></li> - - <li><a href="https://github.com/luevano" target="_blank"><i class="fab fa-github" alt="Github"></i></a></li> - - <li><a href="https://gitlab.com/dluevano" target="_blank"><i class="fab fa-gitlab" alt="Gitlab"></i></a></li> - </ul> - </li> - - <li><i class="fas fa-box-open" alt="Stuff"></i><span>Stuff</span> - <ul> - <li><a href="https://gb.luevano.xyz/"><i class="fas fa-gamepad" alt="Gameboy"></i><span>Gameboy</span></a></li> - </ul> - </li> - </ul> - </nav> - - <button class="theme-switcher" onclick="toggleTheme()"><i class="fas fa-moon"></i><i class="fas fa-sun"></i></button> - </header> - - <main> - <h1> - Test page - </h1> - - <div class="art-grid"> - <img class="wide" src="images/gifs/contact_info_1.gif"> - <img src="images/gifs/dollar_sign_spin_1.gif"> - <img class="tall" src="images/gifs/head_talking_1_trans.gif"> - <img class="wide tall" src="images/gifs/stars_1.gif"> - <img src="images/gifs/under_construction_1.gif"> - <img src="images/gifs/under_construction_2.gif"> - </div> - - <pre><code class="language-gdscript">class_name Player -extends KinematicBody2D - -signal died - -export(float, 1.0, 1000.0, 1.0) var SPEED: float = 180.0 -export(float, 0.01, 100.0, 0.01) var ROT_SPEED: float = 10.0 -export(float, 1.0, 1000.0, 1.0) var JUMP_VELOCITY: float = 380.0 -export(float, 1.0, 100.0, 1.0) var DEATH_JUMP_VELOCITY: float = 250.0 - -onready var sprite: AnimatedSprite = $Sprite -onready var jump_sound: AudioStreamPlayer = $JumpSound -onready var hit_sound: AudioStreamPlayer = $HitSound -onready var dead_sound: AudioStreamPlayer = $DeadSound - -var gravity: float = 10 * ProjectSettings.get_setting("physics/2d/default_gravity") -var velocity: Vector2 = Vector2.ZERO -var last_collision: KinematicCollision2D -var dead: bool = false - - -func _physics_process(delta: float) -> void: - velocity.x = SPEED - velocity.y += gravity * delta - - if Input.is_action_just_pressed("jump") and not dead: - velocity.y = -JUMP_VELOCITY - jump_sound.play() - - if velocity.y < 0.0: - sprite.play() - if rotation > -PI/8: - rotate(-0.05 * ROT_SPEED) - else: - _stop_sprite() - if rotation < PI/2: - rotate(0.01 * ROT_SPEED) - - # maybe can be done with move_and_collide, but this works - velocity = move_and_slide(velocity) - last_collision = get_last_slide_collision() - - if not dead and last_collision: - _emit_player_died() - - -func _stop_sprite() -> void: - if sprite.playing: - sprite.stop() - if sprite.frame != 0: - sprite.frame = 0 - - -# when dying because of boundary -func _on_CeilingDetector_body_entered(body: Node2D) -> void: - _emit_player_died() - - -func _emit_player_died() -> void: - # bit 2 corresponds to pipe (starts from 0) - set_collision_mask_bit(2, false) - dead = true - SPEED = 0.0 - emit_signal("died") - # play the sounds after, because yield will take a bit of time, - # this way the camera stops when the player "dies" - velocity.y = -DEATH_JUMP_VELOCITY - velocity = move_and_slide(velocity) - hit_sound.play() - yield(hit_sound, "finished") - dead_sound.play() - </code></pre> - - </main> - - <footer> - <span> - <i class="fas fa-address-card" alt="Contact"></i> - <a href="https://luevano.xyz/contact.html">Contact</a> - </span> - - <span> - <i class="fas fa-donate" alt="Donate"></i> - <a href="https://luevano.xyz/donate.html">Donate</a> - </span> - - <br> - <span class="copyright"> - Copyright <i class="far fa-copyright" alt="Copyright"></i> 2021 David Luévano Alvarado - </span> - </footer> - </body> -</html> |