Tag Info

Hot answers tagged

2

I can address your ideas and some of the issues related with them. Load zones into memory (i.e. 500x500) and when user goes into next zone disgard and load new 500x500 This is the basic idea of what you want to achieve for a seamless world. However, if left at this basic approach you will incur what is known as "image popping". When the player gets ...


2

I don't know what RawImage exactly is here, but once you access pixel data of a Volatile or BufferedImage in Java you lose hardware acceleration. So even if these images were stored in vram before you called renderImage, they will no longer be once you access the underlying pixel array.


1

if i get this right, you are trying to get the "game world" pos from screen pos, as mentioned in their wiki- // x and y are your screen coordinates // (e.g. where a click/touch happened) Vector3 worldCoordinates = new Vector3(x, y, 0); camera.unproject(worldCoordinates);


1

Use another set of variables to track where you are suppose to be, as well as where you are at. if(key == KeyEvent.VK_A && ((Player)object).velY == 0){ object.setVelX(-3); ((Player)object).setDirection(Direction.LEFT); currentTileX -= 32; } And then you could do something like this public void tick() { if (x != currentX ...


1

A rotation is essentially that for each sample in the resulting grid, find out which texels in your original texture that your filter footprint covers and interpolate them accordingly. This will be a lossy process, and if done repeatedly will quickly obliterate all interesting information in the image. If you only look at the nearest texel, you'll get a box ...


1

You could use an ArrayList to store all your stars in. When collision is detected you remove star from array so the star is no longer updated. So : create : ArrayList <Star> stars= new ArrayList<Star>(); add the stars : stars.add (new Star (param1, param2)); update : for (int i = 0; i < stars.size(); i++) { ...


1

Im not sure this works 100% but here is an idea to get you started. Let your square have x,y as center and r as its current rotation value. Let dx and dy be the displacement from center to one corner of the square when r is 0; On rotate-moving the square on the said corner: First get the corner's position: cx = x + rotated(dx, r); cy = y + rotated(dy, ...



Only top voted, non community-wiki answers of a minimum length are eligible