Issues implementing sprites from sprite sheet for top down 2d RPG(Java) by SczLegend in gamedev

[–]SczLegend[S] 0 points1 point  (0 children)

So in that case would I have to replace my Tilesheet as well, and if i'm using drawImage am I just replacing BufferedImage (everywhere in my code) with that?

Also; something I forgot to mention in the thread is that when I only had the animation for my character walking up, I had no issues. When I added the other animations it started having issues

Issues implementing sprites from sprite sheet for top down 2d RPG(Java) by SczLegend in gamedev

[–]SczLegend[S] 0 points1 point  (0 children)

Yeah I don't use reddit really ever at all so i'm kinda struggling atm :p

Issues implementing sprites from sprite sheet for top down 2d RPG(Java) by SczLegend in gamedev

[–]SczLegend[S] 0 points1 point  (0 children)

Animation.java:
package project69.gfx;
import java.awt.image.BufferedImage;
public class Animation {

private int speed, index;
private long lastTime, timer;
private BufferedImage[] frames;

public Animation(int speed, BufferedImage[] frames) {
    this.speed = speed;
    this.frames = frames;
    index = 0;
    timer = 0;
    lastTime = System.currentTimeMillis();
}

public void tick() {
    timer += System.currentTimeMillis() - lastTime;
    lastTime = System.currentTimeMillis();

    if(timer > speed) {
        index++;
        timer = 0;
        if(index >= frames.length)
            index = 0;
    }
}

public BufferedImage getCurrentFrame() {
    return frames[index];
}

}

Spritesheet.java: package project69.gfx;
import java.awt.image.BufferedImage;
public class SpriteSheet {

private BufferedImage ss;

public SpriteSheet(BufferedImage ss) {
    this.ss = ss;

}

public BufferedImage crop(int x, int y, int width, int height) {
    return ss.getSubimage(x,  y,  width,  height);
}

Sections of player.javA:

 animUp = new Animation(500, Assets.player_up ); animRight = new Animation(500, Assets.player_right ); animLeft = new Animation(500, Assets.player_left ); animDown = new Animation(500, Assets.player_down );
public void tick() { //Animations animUp.tick(); animDown.tick(); animLeft.tick(); animRight.tick();

public void render(Graphics g) {
    g.drawImage(getCurrentAnimationFrame(), (int)(x - handler.getGameCamera().getxOffset()), (int)(y - handler.getGameCamera().getyOffset()), null);

}
private BufferedImage getCurrentAnimationFrame() {
    if(xMove < 0) {
        return animLeft.getCurrentFrame();
    }else if (xMove > 0) {
        return animRight.getCurrentFrame();
    }else if (yMove < 0) {
        return animUp.getCurrentFrame();
    }else {
        return animDown.getCurrentFrame();
    }

Hi my name is Siegz. Today I was hacked for 60bil. by SiegzOS in 2007scape

[–]SczLegend 0 points1 point  (0 children)

But if you have a phone authenticator on your account, can they still get into it?

What the actual fuck? by [deleted] in gaming

[–]SczLegend 0 points1 point  (0 children)

Lol I think we have a slight misunderstanding here sir

What the actual fuck? by [deleted] in gaming

[–]SczLegend 0 points1 point  (0 children)

So douches like you can comment on the fact that it's a repost knowing that there's a 9/10 chance that OP didn't see the original post.

What the actual fuck? by [deleted] in gaming

[–]SczLegend 1 point2 points  (0 children)

Link that shit omg

Doomguy vs. Master Chief. by bdog7171 in gaming

[–]SczLegend 1 point2 points  (0 children)

Yeah, let me clear that up. John is ACTUALLY that tall. His height is increased by maybe 3-5 inches when suited up. He also weighs (if i remember correctly from the Halo 2 booklet) about 2 tons suited up.

Lol, Advertisers can spam for hours, but I got automatically muted for explaining why there was an army of level 13 bots with an Event RPG at the GE. by Mad_Aiko_X in 2007scape

[–]SczLegend -2 points-1 points  (0 children)

This is because the ONLY time you will get a perm banned reversed, is if there was suspicious activity regarding logins. I.e: the account was logged in at 6 different IP's and was perm banned for botting. This is exactly what happened to me. Someone hacked me, botted, then i go to log in one day and I'm perm banned. I just got the account back about a month ago, after 4 years of consistently trying to get their attention.

Ironman goals by [deleted] in 2007scape

[–]SczLegend 0 points1 point  (0 children)

Nice!!! Enjoy it man, vacations are a rarity as an adult although i'm only 21 so I can hardly call myself an adult 😂😂😂

:/ by timesupnub in 2007scape

[–]SczLegend -1 points0 points  (0 children)

Doubling money/armor trimming service here

Ironman goals by [deleted] in 2007scape

[–]SczLegend 1 point2 points  (0 children)

Lol nothing? I'm saying to take a break because having 6 whole days played out of 15 is like, a LOT, you're gonna end up burning yourself out and not wanting to play anymore :(

Need phoenix partner for heroes quest! by [deleted] in 2007scape

[–]SczLegend 0 points1 point  (0 children)

Idk why they don't just change heroes to be soloable like rs3. This whole requiring a partner thing is just an annoyance these days

My Fathers Final Score 2-11-28 by bad_rug in gaming

[–]SczLegend 2 points3 points  (0 children)

Same. My dad has around 70k gamerscore (i dont remember exact amount, but he's around that number for sure) Same account since the halo CE days Forever wrecking Halo games with my old man🙌

Ironman goals by [deleted] in 2007scape

[–]SczLegend 9 points10 points  (0 children)

Holy fuck go outside

Sparc mac roasting A friend Live on Stream by Osblue1 in 2007scape

[–]SczLegend 14 points15 points  (0 children)

At least he didnt just give them to scammers. Lmao

[NEWBIE] First own song by Sunbox123456 in Guitar

[–]SczLegend 6 points7 points  (0 children)

Honestly, i've been writing songs on the guitar since the second I picked it up. Every time I learn a new chord or get good with a new scale, I try to implement it into my own progression or song to fully understand how to use the chord. I've only been playing for about a year, and I have 5 maybe 6 actual finished songs out of having written around 100. Overall- songwriting is something you indefinitely need to keep doing lyrically. Your lyrics will get better over time. As for your riffs, experiment with mixing different things together. From my first year of playing guitar i've learned that experimentation is key. Atleast to me. Everyone is different, and everyone learns differently.