Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

1075918 Posts in 44152 Topics- by 36120 Members - Latest Member: Royalhandstudios

December 29, 2014, 03:02:54 PM
TIGSource ForumsDeveloperTechnical (Moderators: Glaiel-Gamer, ThemsAllTook)Using a spritesheet in java
Pages: [1]
Print
Author Topic: Using a spritesheet in java  (Read 608 times)
Floorman
Guest
« on: January 30, 2012, 03:23:05 PM »

Hello,

I can make small game confidently in Java, I know a fair amount of the basic theory and such (except the Math, I suck at the Math side of things) and I had one question.

I saw Notch coding Minicraft for LD22 and I saw that he used a single 256x256 px grid and draw icons onto the sheet and he was able to somehow take any icon he wanted and draw it somehow using bitwise operation.

How?

I also saw at the start he modified the pixels directly (DataBufferInt) and then drew another screen over it. Why? I don't get why that would be necessary but I am very interested with this method of loading images and I want to know how to do this.

Does anyone have any idea of how he is doing this?

Thanks,
Logged
JMickle
Level 10
*****


lqikq come home


View Profile
« Reply #1 on: January 31, 2012, 07:09:52 AM »

All LD entries are open-source as a rule, so you can actually go and grab the source code and find out from there!
Logged

st33d
Guest
« Reply #2 on: February 01, 2012, 05:48:42 AM »

Why? I don't get why that would be necessary

Because the competition has time constraints. By doing that he saved himself a lot of time making more sprites.
Logged
Dacke
Level 10
*****


I have never been to Woodstock


View Profile
« Reply #3 on: March 22, 2012, 08:12:03 AM »

Catacomb Snatch (also created by Mojang/Notch) uses the same approach (I think). The source code is available online, for example in an actively developed fork on github. The relevant code can be seen here:
https://github.com/Maescool/Catacomb-Snatch/tree/develop/src/com/mojang/mojam/screen

As the fork is active, you can also ask people (like me) about details regarding the implementation. Either here, in an issue at github or at the project's forums.
Logged

programming • veganism • feminism • free software
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic