juku / libgdx-test-rpg Goto Github PK
View Code? Open in Web Editor NEWAn little test for libGDX game engine
License: Other
An little test for libGDX game engine
License: Other
If you zoom with mouse, game world will zoom, but Skybox not.
To find an specific entity it can be an good idea to support adding entities with an unique name.
Get mouse angle relative to player for projectiles.
The client needs support for map collision.
Add an Component SetCursorComponent to set an specific mouse cursor, if player hovers entity.
Replace logic in FollowCameraComponent and add an smooth camera.
An component is required to set right animation state (walkingLeft, walkingRight and so on), so right animation will be drawn.
If you zoom, the hover effect isnt working correctly, the hitbox isnt correct.
Add support for static size of lighting.
Every projectile needs an TTL, so game can remove projectiles after an specific time.
Add component to support particle effects.
The client needs support for map collision.
If you remove an entity in update() method of component, this will cause an ConcurrentModificationException or an NullPointerException.
Entity update() method:
public void update(BaseGame game, GameTime time) {
//update all components
this.updateComponentList.stream().forEach(component -> {
component.update(game, time);
});
}
BaseECS update() method:
public void update (BaseGame game, GameTime time) {
this.entityUpdateList.stream().forEach(entity -> {
//update entity
entity.update(game, time);
});
}
Stream throws an ConcurrentModificationException, if list was updated while iterating over it.
BaseECS removeEntity() method:
public void removeEntity (Entity entity) {
if (entity == null) {
throw new NullPointerException("entity cannot be null.");
}
//get entityID
final long entityID = entity.getEntityID();
synchronized (this.entityUpdateList) {
//remove entity
this.entityUpdateList.remove(entity);
}
synchronized (this.entityDrawList) {
//remove entity
this.entityDrawList.remove(entity);
}
synchronized (this.entityUILayerDrawList) {
//remove entity
this.entityUILayerDrawList.remove(entity);
}
this.entityMap.remove(entityID);
//call listeners
onEntityRemoved(entity);
//dispose entity
entity.dispose();
}
To fix this problem, their are 2 possibilities:
We have to reset animation elapsed time, if animation state was set, else new animation starts with wrong frame number.
For ActionBar an cooldown timer is required.
It should be possible to spawn projectiles after clicking an mouse button.
Currently, the lightmaps arent centralized on entites.
Currently on every shadow generation an new Pixmap will be created, so it cause into GC problems.
Check GC Pressure.
Add an component for HP (min value, max value, current value) and an component to draw HP over entity.
Hover Texture isnt drawn centralized.
Maybe the lighting framebuffer isnt cleared correctly, so some artifacts are shown, if you zoom with mouse.
Add support for blob shadows as component.
Attachment Points
Add support for TMX Layer no_lighting and draw black rectangles in lighting framebuffer.
Add support to play video, for example in intro screen.
We need an component which supports draw of animations with texture atlas.
Lightmaps should be supported.
Exception Stacktrace:
Exception in thread "LWJGL Application" java.lang.IllegalArgumentException: object has to be an instance of PositionComponent to check, if equals.
at com.jukusoft.libgdx.rpg.engine.entity.impl.component.PositionComponent.equals(PositionComponent.java:288)
at java.util.ArrayList.remove(ArrayList.java:528)
at com.jukusoft.libgdx.rpg.engine.entity.Entity.removeComponent(Entity.java:187)
at com.jukusoft.libgdx.rpg.engine.entity.Entity.lambda$dispose$3(Entity.java:273)
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1374)
at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
at com.jukusoft.libgdx.rpg.engine.entity.Entity.dispose(Entity.java:272)
at com.jukusoft.libgdx.rpg.engine.entity.impl.BaseECS.removeEntity(BaseECS.java:211)
at com.jukusoft.libgdx.rpg.engine.entity.impl.BaseECS.removeAllEntities(BaseECS.java:238)
at com.jukusoft.libgdx.rpg.game.screen.GameScreen.onPause(GameScreen.java:172)
at com.jukusoft.libgdx.rpg.engine.screen.impl.DefaultScreenManager.pop(DefaultScreenManager.java:91)
at com.jukusoft.libgdx.rpg.game.screen.GameScreen.onPause(GameScreen.java:169)
at com.jukusoft.libgdx.rpg.engine.game.ScreenBasedGame.lambda$destroyGame$2(ScreenBasedGame.java:55)
at java.lang.Iterable.forEach(Iterable.java:75)
at com.jukusoft.libgdx.rpg.engine.game.ScreenBasedGame.destroyGame(ScreenBasedGame.java:54)
at com.jukusoft.libgdx.rpg.engine.game.BaseGame.dispose(BaseGame.java:382)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:245)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:126)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.