Join us on Discord!
You can help CodeWalrus stay online by donating here.
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - kotu

#901
Other / Re: fods
October 21, 2016, 03:10:52 AM
sometimes i make lentil dhal
#902
plus

he misspelt dj as jd once

for ages
#903
Quote from: p2 on October 20, 2016, 08:35:17 PM
all we need is one super-bored over-motivated guy for every language xD
German one here ;D ;)

dont

i think p2 would mistranslate for cash.
#904
erm i just tried this out on CEmu. that's not exactly what happened, but pretty close.
#905


this is what i done

TileTestApp.java

package tiletest;

import javax.swing.JFrame;
import javax.swing.JPanel;
import tiletest.TileArea;

public class TileTestApp
{
public static void main(String[] args)
{
JFrame frame = new JFrame("TileTest");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

// add TileArea to the JFrame here
TileArea tileArea = new TileArea(600, 408);
frame.add("Center", tileArea);
frame.pack();
    frame.setVisible(true);

// load tileset
TileSource tiles = new TileSource("all-3.png", 24);

//----
int r = 1;
for (;;) {
for (int x = 0; x < 25; x++) {
for (int y = 0; y < 17; y++) {
tileArea.drawTile(tiles, 0, 3, tiles.getTileSize()*x, tiles.getTileSize()*y);
tileArea.drawTile(tiles, r, 1, tiles.getTileSize()*x, tiles.getTileSize()*y);
}
}
frame.repaint();
r++;
if (r==3) r = 1;

try { // wait 10ms to avoid any flicker
    Thread.sleep(10);
} catch(InterruptedException ex) {
    Thread.currentThread().interrupt();
}
}
}
}


TileArea.java

package tiletest;

import java.awt.*;
import java.awt.image.*;

public class TileArea extends Component
{
private BufferedImage m_image;
private int m_width, m_height;

public TileArea(int width, int height)
{
m_width = width;
m_height = height;
m_image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
}

public Dimension getPreferredSize()
{
        return new Dimension(m_width, m_height);
    }

public void paint(Graphics g)
{
g.drawImage(m_image, 0, 0, null);
}

public void drawTile(TileSource tileSource, int tilex, int tiley, int x, int y)
{
Graphics2D g = m_image.createGraphics();
    g.drawImage(tileSource.getTile(tilex, tiley), x, y, null);
}
}


TileSource.java

package tiletest;

import java.awt.*;
import java.awt.image.*;
import javax.imageio.*;
import java.lang.*;
import java.io.*;
import javax.swing.*;

public class TileSource extends Component
{
private BufferedImage m_tiles;
private int m_tileSize;

public TileSource(String filename, int tileSize)
{
m_tileSize = tileSize;
try {
m_tiles = ImageIO.read(new File(filename));
}
catch (IOException e) { // no need to do anything here
} // m_tiles will be null anyway

if (m_tiles == null) {
JOptionPane.showMessageDialog(null, "p2, no! could not load tileset.");
return;
}
}

public int getTileSize()
{
return m_tileSize;
}

public BufferedImage getTile(int tilex, int tiley)
{
if (m_tiles == null) {
return null;
}
return m_tiles.getSubimage(tilex*(m_tileSize+1)+1, tiley*(m_tileSize+1)+1, m_tileSize, m_tileSize);
}
}


@p2 you should change your TileTestApp.java to the version above.

btw c4ooo it doesn't need optimizing and we dont want it optimized at the minute, lol.
#906
Guys, some interesting news, I have confirmed java's built in functions are capable for p2's usage... i made a tile renderer which draws a 600x408 area at 90fps, drawing all tiles on 2 layers.

he he heh
flump
#907
Other / Re: fods
October 20, 2016, 11:54:39 AM
Quote from: p2 on October 20, 2016, 08:02:56 AM
@kotu: As you were a vegetarian, what do you think about vegan guys? :) (those refusing to eat eggs and milk, too)

i respect them
#908
Site Discussion & Bug Reports / Re: CodeWalrus Ads
October 19, 2016, 07:14:30 PM
Quote from: Juju on October 19, 2016, 07:11:32 PM


This ad speaks to me on unimaginable levels o.o

isn't it just dj showing off about his post count?
#909
LOVE this tune   :)

#910
heheh
#911
i actually wanna stick to the 64k limit and have it in one file

more sociable too
#912
Other / goofs
October 19, 2016, 05:15:02 PM
getting a bit confused by DJs quote and his ad which he placed

i figured maybe what he wants is for us to post lists of shopping lists

i will go first.

here we go... i just bought this...

___________________________________
a 500gm pack of grapes
2 packs of salad
i vanilla yoghurt
2 3oogm packs of sag aloo
1 lemon
1 pack piri piri hummus
1 pack baked strawberries, for fun
430gm pack macaroni cheese
2x1L juice drink (pressed+puree - not from concentrate)**
2 pints cows milk cows milk is holy
2 thin base vegetable pizzas!!

although this list is, i am actually not a vegetarian
although i have been before in the past (15+ years)

this stuff will last me a few days!

after that i eat nothing but dead rats for a week.
then 3 weeks on the sugar and fags.
then i drink silt from a lake.
FINALLY I INJECT MOLTEN METAL INTO MY SKIN
then back on normal food for a bit.



**apple 33% orange 21% pineapple 21% mango puree 15%
passion fruit puree 5% banana puree 5%
this stuff is quite thick and i think it is good
for bodybuilding. no more data
#913
thanks for your effort

still gonna be able to use the other buildings and the spaceships.
#914
p2: i like what you did, however i can't use this for 2/3 reasons..

1) the base is supposed to be made of something approximate to extremely dense concrete so has to be grey.
2) the tiles don't repeat and therefore..
3) the graphic would use 20k. my binary file size is limited to 64k and already i'm using 30k, this is with most code still to be written too.

*edit*
plus, a mech base probably would be grey and not black.  O.O
#915
Games / Re: Tach Chess
October 19, 2016, 03:45:20 AM
Wow. You played it?
Powered by EzPortal