Giter Site home page Giter Site logo

too-butano's Introduction

  • ๐Ÿ‘‹ Hi, Iโ€™m @taellinglin You can call me Ling Lin or just Ling
  • ๐Ÿ‘€ Iโ€™m interested in ... GBA Programming, Tracker and MIDI composition, Godot, Webapps, ORM, MVC, and AI
  • ๐ŸŒฑ Iโ€™m currently learning ... Rust. Flask Webapp Development, Artificial Intelligence
  • ๐Ÿ’ž๏ธ Iโ€™m looking to collaborate on ... GBA Projects, Dreamcast, N64, etc. I make great music for games. I also sometimes make webapps.
  • ๐Ÿ“ซ How to reach me ... Try this phone number: 1-224-220-7291 Or this phone number: 1-707-622-6956โ€ฌ (I will change my phone number if I get too many spam calls!!!) [email protected]

too-butano's People

Contributors

taellinglin avatar

Stargazers

 avatar

Watchers

 avatar

too-butano's Issues

Player animation crashes ROM

Upon just button mashing it seems like you can trip the animation to freeze. There are several times the Player Sprite has gotten stuck on one animation frame or crashes with this error.
image

I think it has something to do with sliding...

Level somehow adds bitmap and it doesn't render the palette correct.

Compare the working level to the one that is rendering the palette incorrectly

The working "Limbo 2" .cpp file:
`
#include "too_scene_limbo2.h"

//butano
#include "bn_core.h"
#include "bn_math.h"
#include "bn_log.h"
#include "bn_keypad.h"
#include "bn_string.h"
#include "bn_fixed_point.h"
#include "bn_sprite_ptr.h"
#include "bn_camera_ptr.h"
#include "bn_regular_bg_ptr.h"
#include "bn_affine_bg_ptr.h"
#include "bn_affine_bg_map_ptr.h"
#include "bn_optional.h"
#include "bn_span.h"
#include "bn_affine_bg_map_cell.h"
#include"bn_format.h"

//fe code
#include "too_level.h"
#include "too_player.h"
#include "too_scene.h"
#include "too_npc.h"
#include "too_tooltip.h"
#include "too_npc_type.h"
#include "too_enemy.h"
#include "too_enemy_type.h"
#include "too_data.h"
#include "too_story_save.h"

#include <bn_affine_bg_map_cell.h>

//assets
#include "bn_sprite_items_debug.h"
#include "bn_sprite_items_cat_sprite.h"
#include "bn_affine_bg_items_limbo2.h"
#include "bn_regular_bg_items_background.h"
#include "bn_music_items.h"
#include "bn_music_actions.h"

#include "bn_sprite_text_generator.h"
#include "variable_8x8_sprite_font.h"

namespace too
{
Scene Limbo2::execute(Player player, bn::fixed_point spawn_location)
{
bn::camera_ptr camera = bn::camera_ptr::create(spawn_location.x(), spawn_location.y());

    bn::music_items::valley.play();

    bn::sprite_text_generator text_generator(variable_8x8_sprite_font);
    // map

    bn::regular_bg_ptr background = bn::regular_bg_items::background.create_bg(0, 0);
    bn::affine_bg_ptr map = bn::affine_bg_items::limbo2.create_bg(512, 512);
    background.set_priority(2);
    //map_background.set_priority(1);
    map.set_priority(0);
    too::Level level = too::Level(map);
    //map_background.set_horizontal_scale(1);
    //map_background.set_vertical_scale(1);
    map.set_horizontal_scale(1);
    map.set_vertical_scale(1);
    // camera
    map.set_camera(camera);
    //map_background.set_camera(camera);
    
    // bn::fixed max_cpu_usage;
    // int counter = 1;

           //Enemies
    bn::vector<Enemy, 32> enemies = {};
    //enemies.push_back(Enemy(256, 256, camera, map, ENEMY_TYPE::SLIME, 2));
    //enemies.push_back(Enemy(256+18*8, 256+23*8, camera, map, ENEMY_TYPE::BAT, 1));
    //enemies.push_back(Enemy(256+9*8, 256+9*8, camera, map, ENEMY_TYPE::SLIME, 2));
    //enemies.push_back(Enemy(256+18*8, 256+7*8, camera, map, ENEMY_TYPE::SLIME, 2));
    //enemies.push_back(Enemy(256+25*8, 256+17*8, camera, map, ENEMY_TYPE::BAT, 1));
    StorySave portal = StorySave(bn::fixed_point(960, 194), STORY_TYPE::BEGINNING, camera, text_generator);
    StorySave portal2 = StorySave(bn::fixed_point(80, 912), STORY_TYPE::BEGINNING, camera, text_generator);

    // player
    player.spawn(spawn_location, camera, map, enemies);
    while(true)
    {
        portal.update();
        portal2.update();
        if(bn::keypad::up_pressed())
        {
            if(player.pos().x() < 960+16 && player.pos().x() > 960-16){
                if(player.pos().y() < 194+16 && player.pos().y() > 194-16){
                    return Scene::LIMBO2_LIMBO3;
                }
            }
            if(player.pos().x() < 80+16 && player.pos().x() > 80-16){
                if(player.pos().y() < 912+16 && player.pos().y() > 912-16){
                    return Scene::LIMBO2_LIMBO1;
                }
            }
        }
        
        // max_cpu_usage = bn::max(max_cpu_usage, bn::core::last_cpu_usage());
        // --counter;
        // if(! counter)
        // {
        //     BN_LOG("cpu:" + bn::to_string<32>((max_cpu_usage * 100).right_shift_integer()));
        //     max_cpu_usage = 0;
        //     counter = 60;
        // }
        for(Enemy& enemy : enemies){
            if(bn::abs(enemy.pos().x() - camera.x()) < 240 && bn::abs(enemy.pos().y() - camera.y()) < 160){
                enemy.update();
            } else {
                enemy.set_visible(false);
            }
        }


        player.update_position(map, level);
        player.apply_animation_state();
        // BN_LOG(bn::to_string<32>(player.pos().x())+" " + bn::to_string<32>(player.pos().y()));
        
        
        bn::core::update();
    }
}

}`

This is the "Limbo 1" .cpp file:

`
#include "too_scene_limbo1.h"

//butano
#include "bn_core.h"
#include "bn_math.h"
#include "bn_log.h"
#include "bn_keypad.h"
#include "bn_string.h"
#include "bn_fixed_point.h"
#include "bn_sprite_ptr.h"
#include "bn_camera_ptr.h"
#include "bn_regular_bg_ptr.h"
#include "bn_affine_bg_ptr.h"
#include "bn_affine_bg_map_ptr.h"
#include "bn_optional.h"
#include "bn_span.h"
#include "bn_affine_bg_map_cell.h"
//#include"bn_format.h"

//fe code
#include "too_level.h"
#include "too_player.h"
#include "too_scene.h"
#include "too_npc.h"
#include "too_tooltip.h"
#include "too_npc_type.h"
#include "too_enemy.h"
#include "too_enemy_type.h"
#include "too_data.h"
#include "too_story_save.h"

#include <bn_affine_bg_map_cell.h>

//assets
#include "bn_sprite_items_debug.h"
#include "bn_sprite_items_cat_sprite.h" //cat_sprite.h
#include "bn_regular_bg_items_background.h" //background.bmp
#include "bn_affine_bg_items_limbo1.h" //limbo1.bmp
#include "bn_music_items.h" //songs
#include "bn_music_actions.h"

#include "bn_sprite_text_generator.h"
#include "variable_8x8_sprite_font.h"

namespace too
{
Scene Limbo1::execute(Player player, bn::fixed_point spawn_location)
{
bn::camera_ptr camera = bn::camera_ptr::create(spawn_location.x(), spawn_location.y());

    bn::sprite_text_generator text_generator(variable_8x8_sprite_font);

    
    // map
    bn::regular_bg_ptr map_bg = bn::regular_bg_items::background.create_bg(0, 0);
    bn::affine_bg_ptr map = bn::affine_bg_items::limbo1.create_bg(512, 512);
    map_bg.set_priority(2);
    //map_background.set_priority(1);
    map.set_priority(0);
    too::Level level = too::Level(map);

    //bn::music_items::secret_room.play(0.5);
    //map_background.set_horizontal_scale(1);
    //map_background.set_vertical_scale(1);
    map.set_horizontal_scale(1);
    map.set_vertical_scale(1);
    // camera
    map.set_camera(camera);
    
    // bn::fixed max_cpu_usage;
    // int counter = 1;
    

    bn::vector<Enemy, 32> enemies = {};

    // player
    player.spawn(spawn_location, camera, map, enemies);

    StorySave to_limbo2 = StorySave(bn::fixed_point(944, 736), STORY_TYPE::BEGINNING, camera, text_generator);



    while(true)
    {
        for(Enemy& enemy : enemies){
            if(bn::abs(enemy.pos().x() - camera.x()) < 240 && bn::abs(enemy.pos().y() - camera.y()) < 160){
                enemy.update();
            } else {
                enemy.set_visible(false);
            }
        }
        // max_cpu_usage = bn::max(max_cpu_usage, bn::core::last_cpu_usage());
        // --counter;
        // if(! counter)
        // {
        //     BN_LOG("cpu:" + bn::to_string<32>((max_cpu_usage * 100).right_shift_integer()));
        //     max_cpu_usage = 0;
        //     counter = 60;
        // }
        to_limbo2.update();
        if(bn::keypad::up_pressed())
        {
            if(player.pos().x() < 944+16 && player.pos().x() > 944-16){
                if(player.pos().y() < 736+16 && player.pos().y() > 736-16){
                    return Scene::LIMBO1_LIMBO2;
                }
            }
        }

        player.update_position(map, level);
        player.apply_animation_state();
        // BN_LOG(bn::to_string<32>(player.pos().x())+" " + bn::to_string<32>(player.pos().y()));
        
        
        bn::core::update();
    }
}

}`

and the possibly offending .bmp, but the green transparent is the first color, it's indexed 16 colors, and no colorspace info.

The .h files that correspond to the above files are nearly identical as well.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.