Skip to content

Instantly share code, notes, and snippets.

View teukstrid's full-sized avatar

Astrid Skillingstad teukstrid

  • Sweden
View GitHub Profile
@teukstrid
teukstrid / ini_load
Created May 27, 2018 08:02
ini_load
///@arg = file_name
var _file_name = argument0;
global.load = true;
ini_open(_file_name);
var _room_name = ini_read_string("Level", "Room", "");
global.start_x = ini_read_real("Level", "Start x", 0);
global.start_y = ini_read_real("Level", "Start y", 0);
@teukstrid
teukstrid / ini_save
Created May 27, 2018 08:01
ini_save
///@arg file_name
var _file_name = argument0;
ini_open(_file_name);
ini_write_string("Level", "Room", room_get_name(room));
ini_write_real("Level", "Start x", global.player_start_position.x);
ini_write_real("Level", "Start y", global.player_start_position.y);
ini_write_real("Player", "Health", global.player_health);
ini_write_real("Player", "Max Health", global.player_max_health);
ini_write_real("Player", "Stamina", global.player_stamina);
@teukstrid
teukstrid / o_player_collision_with_hitbox
Created May 24, 2018 07:44
o_player_collision_with_hitbox
/// @description Hit logic
if hurtbox_entity_can_be_hurt_by(other)
{
invincible_ = true;
alarm[0] = global.one_second *0.75;
global.player_health -= other.damage;
var _direction = point_direction(other.x, other.y, x, y);
set_movement(_direction, other.knockback_);
state_ = player.hit;
event_user(state_);
@teukstrid
teukstrid / hitbox_entity_can_be_hurt
Created May 24, 2018 07:43
hitbox_entity_can_be_hurt
///@arg hitbox
var _hitbox = argument0;
var _is_target = is_target(object_index, _hitbox.targets_);
return !invincible_ && _is_target;
@teukstrid
teukstrid / hornet_attack_state
Created May 24, 2018 07:42
hornet_attack_state
/// @description Attack State
if !instance_exists(o_player) {
state_ = hornet.move;
exit;
}
add_friction_to_movement_entity();
move_movement_entity(true);
@teukstrid
teukstrid / hornet_create
Created May 24, 2018 07:41
hornet_create
event_inherited();
initialize_movement_entity(.25, .5, o_solid);
enum hornet {
hit,
move,
attack
}
starting_state_ = hornet.move;
@teukstrid
teukstrid / create_hitbox
Created May 13, 2018 19:38
create_hitbox
///@arg sprite
///@arg x
///@arg y
///@arg angle
///@arg frames
///@arg target_array
///@arg damage
///@arg knockback
var _sprite = argument0;
var _x = argument1;
@teukstrid
teukstrid / User Event 1 - Sword State
Created May 13, 2018 19:36
User Event 1 - Sword State
/// @description Sword State
image_speed = .8;
if animation_hit_frame(1)
{
var _angle = direction_facing*90;
var _life = 3;
var _damage = 1;
var _knockback = 8;
create_hitbox(s_sword_hitbox, x, y,_angle , _life, [], _damage, _knockback)
@teukstrid
teukstrid / PlayerViewPoint log
Created May 5, 2018 17:59
PlayerViewPoint log problem
#include "Grabber.h"
#include "BuildingEscape.h"
#include "Components/InputComponent.h"
#include "GameFramework/Actor.h"
#include "CoreMinimal.h"
#include "Engine.h"
// Sets default values for this component's properties
UGrabber::UGrabber()
EGuessStatus FBullCowGame::CheckGuessValidity(FString Guess) const
{
if (!IsIsogram(Guess))
{
return EGuessStatus::Not_Isogram;
}
else if (false)
{
return EGuessStatus::Not_Lowercase;
}