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
For ActionBar an cooldown timer is required.
The client needs support for map collision.
Currently, the lightmaps arent centralized on entites.
Get mouse angle relative to player for projectiles.
Add support for TMX Layer no_lighting and draw black rectangles in lighting framebuffer.
Maybe the lighting framebuffer isnt cleared correctly, so some artifacts are shown, if you zoom with mouse.
It should be possible to spawn projectiles after clicking an mouse button.
We have to reset animation elapsed time, if animation state was set, else new animation starts with wrong frame number.
The client needs support for map collision.
Add an Component SetCursorComponent to set an specific mouse cursor, if player hovers entity.
If you zoom with mouse, game world will zoom, but Skybox not.
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:
If you zoom, the hover effect isnt working correctly, the hitbox isnt correct.
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)
Replace logic in FollowCameraComponent and add an smooth camera.
To find an specific entity it can be an good idea to support adding entities with an unique name.
Add support for blob shadows as component.
Hover Texture isnt drawn centralized.
Lightmaps should be supported.
Add component to support particle effects.
Add support for static size of lighting.
Currently on every shadow generation an new Pixmap will be created, so it cause into GC problems.
An component is required to set right animation state (walkingLeft, walkingRight and so on), so right animation will be drawn.
Check GC Pressure.
Every projectile needs an TTL, so game can remove projectiles after an specific time.
Add support to play video, for example in intro screen.
Attachment Points
We need an component which supports draw of animations with texture atlas.
Add an component for HP (min value, max value, current value) and an component to draw HP over entity.
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.