bi_tux

joined 1 year ago
[–] bi_tux 2 points 1 hour ago

hey, I still use XMR to buy my hrt

[–] bi_tux 1 points 1 hour ago

Not in my europe (that's because even our modern houses are at least 50 years old)

[–] bi_tux 1 points 1 hour ago

I watched it, but it wasn't that great

[–] bi_tux 1 points 1 hour ago

there's no conspiracy in that theory

[–] bi_tux 1 points 1 hour ago

I got another one (that's pretty much a fact) in order to get facial recognision, fingerprint sensors, etc working you have to login with your ms/apple/google acc, on windows 7 you didn't have to... now why would you need an online connection to setup a piece of physikal hardware with local sofyware??? It's pretty simple: apple, google and microsoft know your face, your fingerprint, your voice, your location, etc

[–] bi_tux 1 points 1 hour ago

every programming language got something to slow your programm down on purpose (it has legitimate use cases) in rust that would be thread::sleep(Duration::from_secs_f32(0.025))

[–] bi_tux 2 points 1 hour ago* (last edited 1 hour ago)

the feds and big corpos are spying on you and the only reason you're still alive is because

a) you're a small fish

xor

b) you help them in some way by being a usefull idiot

xor

c) you're part of the conspiracy

[–] bi_tux 1 points 1 hour ago

no, you don't understand, the feds invented the perpetum mobile, birds only sit on power lines to confuse people like you!

[–] bi_tux 1 points 1 hour ago

I don't think that's a theory anymore at this point

[–] bi_tux 1 points 1 hour ago

yep, nothing better than a few liters of dark beer with some friends on a summer evening

[–] bi_tux 1 points 1 day ago

one could argue that bigots ARE pretty dumb

286
submitted 2 weeks ago* (last edited 2 weeks ago) by bi_tux to c/[email protected]
 

This happend to me right noww as I tried to write a gui task manager for the GNU/Linux OS

 

also he thought that the CCP wasn't even suppressing free speech, guess who just got banned from a certain tankie cercle jerk instance

 

ofc I imediatly upgraded it from winxp to gnu/linux

 

I hope memes are okay here

77
got a new Laptop (lemmy.world)
submitted 3 months ago by bi_tux to c/[email protected]
 

also ik, I still use neofetch instead of hyfetch

 

So I thought about this in the shower amd it makes sense to me, like praying and stuff never worked for most people I know, so a direkt link to god gotta be unlikely. That made me conclude that religion is probably fake, no matter if there's a god or not. Also people speaking to the same god being given a different set of rules sounds stupid, so at least most religions must be fake.

 

Why do some cars have their engines in the front and some in the back, what are the advantages and disadvantages of the two builds. And why doesn't every car have full wheel drive?

218
doggo (lemmy.world)
submitted 4 months ago by bi_tux to c/aww
 
7
submitted 6 months ago* (last edited 6 months ago) by bi_tux to c/[email protected]
 

So I want to update the sprite so my character looks in a different direction each time the player presses left/right, how could I do this? I can't do it in the setup fn, since it's a startup system, appreciate any help

EDIT: changed formating

here is my code:

use bevy::prelude::*;

`fn main() {
    App::new()
        .add_plugins(DefaultPlugins.set(ImagePlugin::default_nearest())) // prevents blurry sprites
        .add_systems(Startup, setup)
        .add_systems(Update, animate_sprite)
        .add_systems(Update, player_movement_system)
        .run();
}

const BOUNDS: Vec2 = Vec2::new(1200.0, 640.0);
static mut FLIP_BOOLEAN: bool = false;

fn set_flip_boolean(boolean: bool) {
    unsafe {
        FLIP_BOOLEAN = boolean;
    }
}

fn get_flip_boolean() -> bool{
    unsafe {
        FLIP_BOOLEAN
    }
}

#[derive(Component)]
struct Player {
    movement_speed: f32,
}

#[derive(Component)]
struct AnimationIndices {
    first: usize,
    last: usize,
}

#[derive(Component, Deref, DerefMut)]
struct AnimationTimer(Timer);

fn animate_sprite(
    time: Res<Time>,
    mut query: Query<(&AnimationIndices, &mut AnimationTimer, &mut TextureAtlas)>,
) {
    for (indices, mut timer, mut atlas) in &mut query {
        timer.tick(time.delta());
        if timer.just_finished() {
            atlas.index = if atlas.index == indices.last {
                indices.first
            } else {
                atlas.index + 1
            };
        }
    }
}


fn setup(
    mut commands: Commands,
    asset_server: Res<AssetServer>,
    mut texture_atlas_layouts: ResMut<Assets<TextureAtlasLayout>>,
) {
    let texture = asset_server.load("sprites/Idle01.png");
    let layout = TextureAtlasLayout::from_grid(Vec2::new(64.0, 40.0), 5, 1, None, None);
    let texture_atlas_layout = texture_atlas_layouts.add(layout);
    let animation_indices = AnimationIndices { first: 0, last: 4 };
    let boolean = get_flip_boolean();
    commands.spawn(Camera2dBundle::default());
    commands.spawn((
        SpriteSheetBundle {
            texture,
            atlas: TextureAtlas {
                layout: texture_atlas_layout,
                index: animation_indices.first,
            },
            
            ..default()
        },
        Player {
            movement_speed: 500.0,
        },
        animation_indices,
        AnimationTimer(Timer::from_seconds(0.1, TimerMode::Repeating)),
    ));
}

fn player_movement_system(
    time: Res<Time>,
    keyboard_input: Res<ButtonInput<KeyCode>>,
    mut query: Query<(&Player, &mut Transform)>,
) {
    let (guy, mut transform) = query.single_mut();

    let mut movement_factor = 0.0;

    let mut movement_direction = Vec3::X;

    if keyboard_input.pressed(KeyCode::ArrowLeft) {
        movement_factor -= 1.0;
        movement_direction = Vec3::X;
        set_flip_boolean(true);
    }

    if keyboard_input.pressed(KeyCode::ArrowRight) {
        movement_factor += 1.0;
        movement_direction = Vec3::X;
        set_flip_boolean(false);
    }

    if keyboard_input.pressed(KeyCode::ArrowUp) {
        movement_factor += 1.0;
        movement_direction = Vec3::Y;
    }

    if keyboard_input.pressed(KeyCode::ArrowDown) {
        movement_factor -= 1.0;
        movement_direction = Vec3::Y;
    }


    let movement_distance = movement_factor * guy.movement_speed * time.delta_seconds();
    let translation_delta = movement_direction * movement_distance;
    transform.translation += translation_delta;

    let extents = Vec3::from((BOUNDS / 2.0, 0.0));
    transform.translation = transform.translation.min(extents).max(-extents);
}
 

I hope this isn't out of context, also I don't want to "own the libs" or something here, I'm actually interested.

6
submitted 6 months ago* (last edited 6 months ago) by bi_tux to c/health
 

I don't know where else to post this, so here you go:

  • How reliable is the yazio kcal counter
  • Does it use anything
  • Are there FOSS alternatives

the reason I'm asking is because I weighted everything I ate and put it into the app, according to the app I should have eaten 1600kcal, but I feel lile I ate 3000kcal

EDIT: I mean the kcal I ate all day, I didn't eat that much at once obviosly

would appreciate help and advise

view more: next ›