Questions tagged [java]

Java is both a popular object-oriented programming language and runtime environment which allows Java programs to run unchanged on most hardware and software platforms.

Filter by
Sorted by
Tagged with
-1
votes
2answers
44 views

How to load 3D modells when they are necessary

I'm working on a 3D game engine, currently I load ALL of my 3D modells into the memory when my game starts, but obviusly there will be hundreds of 3D modells, so somehow I should unload them when they ...
1
vote
0answers
15 views

How do I run LibGDX's Particle Editor in Netbeans?

I am trying to run the Particle Editor that comes with LibGDX in Netbeans. The gdx-tools-1.9.10.jar file shows up in my dependencies, and I can see all of the ...
1
vote
0answers
19 views

LibGDX Change mouse cursor to custom image…and keep it there

I'm able to create a custom cursor no problem using the following code running in my GameScreen's Show method: ...
0
votes
0answers
17 views

Unknown error when trying to register a Minecraft ArmorItem

The error in question is [Inferred type 'I' for type parameter 'I' is not within its bound; should extend 'net.minecraft.item.Item'] on the following snippet of code ...
1
vote
1answer
45 views

LWJGL 3 HelloWorld example crashing

I'm trying to start LWJGL 3 development and I am having an issue with getting things working. I have created a new Gradle project and successfully built the HelloWorld example from https://www.lwjgl....
1
vote
1answer
26 views

How to clamp a mouse angle within a field of view range of the facing direction

In my top down shooter game, the player can face in any of the 8 compass directions using the keyboard. Depending on the direction, the player will have a 90 degree field of view to turn based on the ...
1
vote
1answer
46 views

A star pathfinding path too narrow for enemy

The tiles for my top down 2D shooter are 32x32 and the player and enemies are too. But obstacles like walls and other things can of course be smaller than this - the smallest being 8x8. This causes a ...
1
vote
1answer
24 views

Libgdx opacity partial error

My model must support transfer textures but I can't do this using mesh + modelBuilder.part Opacity is tested correctly on only half of the model. ...
-4
votes
1answer
27 views

Increase speed when score gets high or when the fish eats pellets

I want fish to increase speed when score gets high, or when the fish eats some balls ...
0
votes
1answer
60 views

How to get started with game development (for a software developer)? [closed]

I know its a pretty common question but the answers i see aren't direct enough... So i'm a software developer for about 5 years now (fullstack and android) and i want to get into game development, but ...
2
votes
1answer
214 views

How can I save game “professionally”?

I am a novice programmer and just learned about the concept of saving and loading games. The way I am doing it is to write data into a text file and read it afterward. However, I realize how insecure ...
0
votes
1answer
15 views

Best way to make a Side Panel UI with Libgdx? (Java)

Take this image for example, the game is called Realm of the mad god, and it has this side panel filling the whole screen height with the player info. To reproduce it, Is there any way to make the ...
0
votes
2answers
51 views

Java LERP but with whole pixel values

I have a formula which returns a Lerp Vector3 value in integers but the problem is it never reaches the desired target value. It'...
0
votes
1answer
29 views

LibGDX Letter spacing is reduced if I use GlyphLayout to draw a bitmap font

I need to use glyphlayout so that I can centre the text, but I found if I do the text gets distorted due to the spacing being incorrect. ...
0
votes
0answers
20 views

Error while trying to Build APK, fails when profile option is enabled

When I build normally my android app it execute without no problems, but when I go to File -> Buil and Run and I eneble Development Build and Autoconnect to profiler I got this error ...
0
votes
1answer
30 views

Looking for tips on how to optimize/debug Java/Eclipse

I made a raycasting engine with wall textures. Before adding the texture the engine was silky smooth. With textures it has small lags (or stutters) when i move around and i would like to know why. My ...
0
votes
0answers
15 views

Flex Build error Error of java

...
0
votes
1answer
29 views

Class Not Found Exception on Class.forName()

Edit: Solved, for some reason my For each loop was getting out of bounds for the Starfish class, so I did a little null check and it worked out fine. I am having this exception on title. I have been ...
1
vote
1answer
26 views

Drawing object lines in the Tiled map editor

Suppose I have this picture: I have a map like this created in Tiled already. I would like to draw collision lines (the green ones in the picture) without having to make it a polygon. As far as I ...
0
votes
0answers
18 views

Dynamic spawn system

What are good approaches or patterns to structure a dynamic spawn system ? It should be able to "create" entities by their type-ID based on a set of rules which are able to change dynamic during ...
0
votes
0answers
10 views
0
votes
0answers
30 views

Is using sprite sheets and drawing specific part the way to go?

I'm programming in Java. I have more than 200 MB of images used in my games, something like 100000 40x40ish images. I initially wanted to load them all during app initialization but it took like 2 ...
1
vote
1answer
37 views

Function to draw an image inside a rectangle

How can I draw an image inside a rectangle? I am introducing myself in the manipulation of images for games, I have a window and inside there is a rectangle that deforms. I would like to fill the ...
0
votes
0answers
27 views

Simple Checkers Game between two users

I am having issues with being able to have a click that occurs in one class interact with another class. I have a CheckerPiece class, where a ...
1
vote
1answer
50 views

How to choose what to use in Java: Enums or Objects?

I'm in a dilemma over using Enum Types or using class objects in that particular part of my java project. Let's suppose I have an array where I constantly add and remove things from it, but I also ...
0
votes
0answers
17 views

Sliding against a wall is “sticky”

I try to implement a ball sliding mechanism in my game. When the ball collides with a wall, it gets bounced. When it's close enough though (after many bounces) it will start to slide against it. But ...
0
votes
0answers
23 views

What design choice should I follow for client-server communication?

My game server currently launches a thread for each connected client, and handles all data exchange through that socket in a server-blocks-until-client-requests fashion. The problem derives from the ...
1
vote
1answer
53 views

Java - set resolution of game

Hi everybody I am making small game using pure Java 8 and rednering it by Java AWT Graphics2D method . My question is how to make that user can change the quality ...
0
votes
0answers
19 views

empty screen in my game

Below are 5 activities that form my simple app; I still can't figure out why it doesn't show anything(only a black empty screen): I have another question: Is there any issue with using time in ...
0
votes
1answer
27 views

Box2d: crash on createBody in beginContact callback

I am getting this error on creating body in contactListener ...
0
votes
1answer
42 views

What is the most efficient way to load all the textures?

I am developing a game (in Java) that is going to have a lot of textures and images in it. What is the most efficient way to load all the textures? I was thinking on pre-loading all the images ...
0
votes
0answers
8 views

adding video to jrame

I am using java to build a game and I want to do something like that example: I am pressing some pre-detmired button that causes a video to start. I want to do something like a cutscene that will ...
0
votes
0answers
28 views

best method to draw in android studio games

After several tries to draw my player, enemy object in my game, I often face a problem rendering either because the method cannot be resolved or because I have a player and enemy classes both extend ...
0
votes
0answers
12 views

LibGDX - Java — How do I determine the alpha value of a pixel programmatically?

My goals are to generate hit boxes and click boxes using alpha values (so that parts of my textures that are invisible remain uninteractable) I have code already for determining if the mouse is ...
0
votes
0answers
36 views

Skybox textures is black

My skybox is displayed, but does not display the textures that I load from the image. Instead, it shows the transparent color if i set glTexImage2D how ...
0
votes
0answers
11 views

LibGDX Scene2D a different way of implementing a GUI scale setting other than multiplying everything by a constant?

I have a bunch of UI elements for my game. I have an inventory, HUD, hotbar, in-game menu etc. Now I want to scale these based on a setting. I import the settings from a file and basically put it in a ...
0
votes
0answers
13 views

moving player according to swipes

In my Player.java class, I want to incorporate a function that moves my player according to the left or right swipes. I also used time in seconds in order to vary the movement in an cyclic way: <...
0
votes
0answers
20 views

Libgdx storing rendered frames quickly to use them later

I have implemented a gif-button for my libgdx game that allows the player to store the last few seconds of gameplay as a gif. It works by storing frames in memory, and encoding them into a gif if the ...
0
votes
0answers
8 views

Problem of activities [duplicate]

My game consists of a player that hopes between ropes. For now, I created the player and the rope classes. Each one contains details about the object and its movement patterns. What is the next step ...
0
votes
0answers
14 views

How to fix “stretched” textures in LibGDX?

I'm drawing textures using SpriteBatch and all textures are stretched. Previously I was using Stage and StretchViewport and back then everything was fine. My code: ...
0
votes
1answer
24 views

Positioning ropes equidistantly on a landscape display

I would like to render 4 similar ropes in my game that are equidistant on a landscape mode display. How can I proceed? My screen is 1920*1080, at 420 dpi. Is there any way that I could link the ...
2
votes
1answer
47 views

Connecting Player and Rope classes in a rope-swinging game

I am trying to build this game where the player hops between a number of ropes. For now, in addition to my main activity that I kept empty, I built two additional classes: ...
0
votes
1answer
37 views

How to make controlled exchanges in an online-game?

There is an online game in which you can collect things of different values: ordinary, epic, legendary. The cheapest things are ordinary, the more expensive are epic, and the most expensive are ...
0
votes
0answers
23 views

Heuristic for Board Game AI Resulting in Tie

I'm developing a program for a Line of Action game (see specs here: http://www.boardspace.net/loa/english/index.html) For the AI, I've created a game tree, pretty similar to most game tree ...
0
votes
1answer
18 views

How do I make an actor move to the foreground temporarily in LibGDX scene2d?

I have an inventory UI which is a table in scene2d. Then the table had a bunch of Containers which are basically inventory slots. They have a transparant grey background color. Then in each container ...
1
vote
0answers
49 views

Hitboxes in a Java game without rectangles

I left this question on "normal" stackOverFlow but they recommended I asked you guys! I am new to making games in Java but I made some games using the paintComponent method, however I felt like I was ...
0
votes
0answers
40 views

Is using an anonymous inner class to determine game item behavior the right way?

I'm developing a little game that has a bunch of different items. I categorize the items in separate classes (consumables, armor, weapons) that all extend Item.class. Then I use one main Items class ...
1
vote
0answers
74 views

What design pattern would be most suitable for RPG skills?

I'm developing a small Java digital card game project. In my game, players can perform skills when using cards. Each skill does different things, like deal damage, heal etc.. I'm looking for a way to ...
1
vote
1answer
51 views

How do you draw a random irregular polygon in java? (Asteroids)

I am coding an Asteroids game in Java. In the real arcade game, asteroids are made of irregular shapes like this: When I code, I can only set asteroids to 1 or another specific shape, like this: ...
0
votes
0answers
23 views

Java clicking on tiles detection

I am making small isometric game, where I want to do something when user clicks a tile. I can simple do it by mouse location, but I want to be able for zooming and moving camera. It will be 2D game ...

1
2 3 4 5
66