Commit graph

178 commits

Author SHA1 Message Date
Kazhnuz
b4f3008552 improvement(actor): put physics functions that make sense in baseactor 2019-06-27 22:14:12 +02:00
Kazhnuz
ff78a6ecfe improvement(actor): put gravity that make sense functions in baseactor 2019-06-27 22:02:47 +02:00
Kazhnuz
10bbd5fd84 improvement(actor): merge most physics initialisation 2019-06-27 21:56:02 +02:00
Kazhnuz
049213000a improvement(world): separate future position and friction from autoMove 2019-06-27 21:29:49 +02:00
Kazhnuz
c57f372648 chore(world): improve separation between bodies and actors in code 2019-06-27 21:22:33 +02:00
Kazhnuz
7cce6ea99f improvement(world): separate queryRect into 2 functions 2019-06-27 21:20:54 +02:00
Kazhnuz
f68e300019 feat(hitbox): add a way to advertise an hitbox as main hitbox 2019-06-27 21:15:57 +02:00
Kazhnuz
0a66082e99 chore(actor2D): group gravity functions together 2019-06-27 21:05:23 +02:00
Kazhnuz
e916c28630 fix(actor2D): simplify gravity system by not handling x by default 2019-06-27 21:03:34 +02:00
Kazhnuz
9f66df8537 fix(actor2D): let hitboxes handle themselves 2019-06-27 20:46:21 +02:00
Kazhnuz
b7344a8973 fix(actor2D): fix a function being put in the wrong object 2019-06-27 20:38:15 +02:00
Kazhnuz
cace01cf3a feat(world): add a way to check every hitbox collisions 2019-06-23 15:53:51 +02:00
Kazhnuz
89b2ffe483 feat(world): add a way to automatically load hitbox from a file 2019-06-23 15:45:34 +02:00
Kazhnuz
3fd8d2fecc fix(hitboxes): reset colors after the hitbox is drawn. 2019-06-23 15:44:46 +02:00
Kazhnuz
eafc266544 fix(baseworld): make baseworld not crash when a body is loaded 2019-06-23 15:39:57 +02:00
Kazhnuz
3314f1e3f9 improvement(actor): ignore by default collision with actor own hitboxes 2019-06-23 15:32:25 +02:00
Kazhnuz
5c5b3eed34 fix(assets): add "return" call that were forgotten 2019-06-23 15:29:08 +02:00
Kazhnuz
dca4ece7fe feat(assets): add a new getCurrentAnimation function 2019-06-23 15:25:56 +02:00
Kazhnuz
6fb3fecc95 feat(assets): add more wrapper around sprite functions in BaseActor 2019-06-23 14:27:07 +02:00
Kazhnuz
a3b6bcd499 feat(world): add a frame hitbox data structure to process
It'll allow us to create a way to process everyframe of an animation and 
change hitbox according to the animation.

It should especially simplify the creation of battle system.
2019-06-23 10:19:01 +02:00
Kazhnuz
f88c7f49e4 feat(world): add multiple hitbox support on actor2D 2019-06-22 22:11:22 +02:00
Kazhnuz
8c1e9d8e05 feat(world): initial support for external hitbox
For the moment it doesn't add any real feature, but it allow the 
mainHitbox to be an external object to the actor, giving to it more 
power.
2019-06-22 19:27:31 +02:00
Kazhnuz
cb97c2ceee chore(world): prepate using an external hitbox object 2019-06-22 17:27:36 +02:00
Kazhnuz
2b1bdd0be5 improvement(world): separate bodies from actor management 2019-06-22 17:19:54 +02:00
Kazhnuz
241baad935 fix(world): remove a forgotten debug function 2019-06-21 20:06:58 +02:00
Kazhnuz
408a71434f fix(world): use right camera internal coordinate
Fixes #15 and #17
2019-06-21 18:50:45 +02:00
Kazhnuz
3ced2dbef4 fix(world): separate getting data from the internal and advertised view
Use two functions instead of just one, one showing the actual dimensions 
of the internal "cam" (basically, the whole screen), and one showing the 
advertised displaced camera.

Fixes #16
2019-06-21 18:27:02 +02:00
Kazhnuz
a227bbb033 feat(world): add a function to reset world 2019-06-16 16:33:29 +02:00
Kazhnuz
f7040d1854 feat(world): draw actors according to their depth
It allow us to draw some sprites always over some others.

Fixes #8
2019-06-16 10:24:30 +02:00
Kazhnuz
54b01b0d94 feat(world): add a creationID variable to keep track of actors ID 2019-06-16 10:08:59 +02:00
Kazhnuz
61b3c29f6b improvement(world): only draw visible actors when a camera is active
It'll make the game less laggy. For the moment, no need to only update 
visible actors.

Fixes #14
2019-06-16 10:00:05 +02:00
Kazhnuz
65b0c74a06 feat(world): add a batchActor function activated by a bool in tiled
This way, you can add multiple actors with just one tiled object. It 
also bring better feature parity with Imperium Porcorum.

Fixes #10
2019-06-15 11:50:53 +02:00
Kazhnuz
4c2427bfd6 feat(world): add a drawHUD function to draw the current HUD
It is able to draw everything a player object want directly where it 
should go.

Fixes #3
2019-06-13 22:23:23 +02:00
Kazhnuz
58b8c95d62 feat(actor): add *Start() and *End() functions 2019-06-13 18:39:09 +02:00
Kazhnuz
80ef8b1a65 gamecore/world: add an activity system for the world 2019-05-30 13:37:55 +02:00
Kazhnuz
23f17491ad gamecore/world: make the world registerable directly by itself 2019-05-28 19:28:05 +02:00
Kazhnuz
fb4f438bf9 modules/world: add a generic gfx actor 2019-05-06 20:44:13 +02:00
Kazhnuz
0ee3220559 modules/world: put the register and initPhysics functions in BaseActor 2019-05-05 21:56:55 +02:00
Kazhnuz
de42087e51 modules/world: init hitbox before loading the parent new() function 2019-05-05 21:55:57 +02:00
Kazhnuz
2344bd5a9a modules/world: put non-hitbox related physics function in baseactor 2019-05-05 21:44:12 +02:00
Kazhnuz
1e42fac57c modules/world: refactor hitbox initialization outside of initPhysics 2019-05-05 21:29:49 +02:00
Kazhnuz
86b1368a6e modules/world: put solidity initialization into baseactor 2019-05-05 21:27:02 +02:00
Kazhnuz
11fcc4cf99 modules/world: refactor movement functions together 2019-05-05 21:25:25 +02:00
Kazhnuz
4b4b8b4e85 modules/world: refactor all cordinate functions together 2019-05-05 21:22:41 +02:00
Kazhnuz
6aa7fd6399 modules/world: use the setBounceFactor function in initPhysics 2019-05-05 21:18:54 +02:00
Kazhnuz
187f0286df modules/world: put the update functions in the baseactor 2019-05-05 21:04:00 +02:00
Kazhnuz
1d26588904 modules/world: put timers and sprites functions in the base actor 2019-05-05 21:01:54 +02:00
Kazhnuz
6225f1fb4e modules/world: put input functions in BaseActor 2019-05-05 20:51:26 +02:00
Kazhnuz
cd62f9c7d1 modules/world: put basic initilisation in baseactor 2019-05-05 20:49:28 +02:00
Kazhnuz
1b5a2e9c6e modules/world: derive the Actor2D from the base actor 2019-05-05 20:30:39 +02:00
Kazhnuz
351b2a970a modules/world: initial draft of the base actor module 2019-05-05 20:30:25 +02:00
Kazhnuz
d1a5bb9d39 modules/world: add a timer system to the actors 2019-05-05 20:13:19 +02:00
Kazhnuz
25a582821f modules/world: only check collision if the object isn't being destroyed 2019-05-05 19:50:33 +02:00
Kazhnuz
dfc71eaebd module/world: add a function to destroy actor 2019-05-05 19:45:57 +02:00
Kazhnuz
146cfbed54 module/world: fix an oops 2019-05-05 19:36:21 +02:00
Kazhnuz
53df3c125c modules/world: add more wrapper around sprites functions 2019-05-05 15:22:54 +02:00
Kazhnuz
8d655f8049 modules/world: make the actors able to clone their sprite 2019-05-05 13:17:43 +02:00
Kazhnuz
174b51acfa modules/world: use checkCollisions to get if an object is on ground 2019-05-05 13:01:25 +02:00
Kazhnuz
b80566b4ec modules/world: add a way to check collisions 2019-05-05 13:01:00 +02:00
Kazhnuz
0d5068fdaa modules/world: add initial way to check if an entity is on ground 2019-05-02 20:10:31 +02:00
Kazhnuz
f04d0c6b4e modules/world: initial gravity system 2019-05-02 19:51:43 +02:00
Kazhnuz
adfa147b72 examples/moveplayer: fix camera2 having the wrong set of coordinate 2019-05-02 18:47:36 +02:00
Kazhnuz
56a269dd57 modules/world: work around Y invertion in the camera system 2019-05-02 18:46:44 +02:00
Kazhnuz
b69ad095ee modules/world: make drawDebugViewBox function related to one view 2019-05-02 18:27:58 +02:00
Kazhnuz
5eed16bac4 modules/world: make local the vx and vy variables 2019-05-02 17:34:35 +02:00
Kazhnuz
eddf66595c modules/world: attach and detach view just once 2019-05-02 17:21:48 +02:00
Kazhnuz
aaf0b1882b modules/world: displace the map according to the view relative position 2019-05-02 16:21:24 +02:00
Kazhnuz
065a67a915 modules/world: add a function to get view relative position 2019-05-02 16:19:59 +02:00
Kazhnuz
f1edd118ec modules/world: simplify limitView() by using utils.math.between() 2019-05-02 16:19:28 +02:00
Kazhnuz
c41930fca4 modules/world: automatize multiple character handling 2019-05-01 17:21:38 +02:00
Kazhnuz
dd21878ee8 modules/world: add an initActors function 2019-05-01 16:25:44 +02:00
Kazhnuz
18d75f825c modules/world: separate map loading from level initialization 2019-05-01 14:36:40 +02:00
Kazhnuz
98fb57afaa modules/world: floor the coordinate for sprite drawing 2019-05-01 11:26:15 +02:00
Kazhnuz
0fba67f212 modules/world: handle differently the coordinate system for 2D actors 2019-05-01 11:19:42 +02:00
Kazhnuz
ce2a89b295 modules/world: fix scalling function
actually adding the scaling would be nice.
2019-05-01 11:16:37 +02:00
Kazhnuz
1a669029ea modules/world: add a basic sprite system for the Actor2D 2019-05-01 11:07:53 +02:00
Kazhnuz
d908604dcb module/world: return camera coordinate in the right order 2019-05-01 10:39:19 +02:00
Kazhnuz
a2d38a1ef4 module/world: make sure that the view doesn't go outside the world 2019-05-01 10:27:07 +02:00
Kazhnuz
fd78d083af modules/world: add a way to load objects from tiled 2019-04-29 16:40:44 +02:00
Kazhnuz
00fe87f61d modules/world: invert player 1 and 2 cam in horizontal split mode 2019-04-29 15:10:02 +02:00
Kazhnuz
882f98bf40 modules/world: add a way to link the camera to an actor 2019-04-29 15:03:28 +02:00
Kazhnuz
cc5de7d5ff modules/world: attach and detach the camera when drawing the map 2019-04-29 14:12:34 +02:00
Kazhnuz
1ba74a534d modules/world: scissor the view when attaching the camera 2019-04-29 14:12:04 +02:00
Kazhnuz
bc0b1bb87b modules/world: initial functions to compute camera size and positionning 2019-04-29 13:58:13 +02:00
Kazhnuz
3c498f2d16 modules/world: add a basic view dimension system 2019-04-29 11:39:07 +02:00
Kazhnuz
a046eb5a9c modules/world: add camera system to the world system 2019-04-29 11:21:41 +02:00
Kazhnuz
ffac18d6a5 modules/world: add a way to get camera scale and view 2019-04-29 11:20:59 +02:00
Kazhnuz
06a5192b84 modules/world: fix a typo 2019-04-29 10:47:01 +02:00
Kazhnuz
699efeb2fb modules/world: add a view number limit 2019-04-29 10:42:43 +02:00
Kazhnuz
79ecdc822b modules/world: only attach view to camera if one is requested 2019-04-29 08:45:48 +02:00
Kazhnuz
9c3ef4ce65 modules/world: add initial basic camera system 2019-04-29 08:44:10 +02:00
Kazhnuz
fc34cdc199 modules/world: set default collision mode to slide 2019-04-28 11:15:35 +02:00
Kazhnuz
5777d9463b modules/world: add a way to simply set bounceFactor in the Actor2D 2019-04-28 11:12:54 +02:00
Kazhnuz
6c2b308580 modules/world: add a way to change speed to collision normal 2019-04-28 11:09:55 +02:00
Kazhnuz
0d25dbd839 modules/world: add collision response system 2019-04-28 11:06:07 +02:00
Kazhnuz
c43317bfe2 modules/world: add friction system to Actor2D 2019-04-28 09:31:10 +02:00
Kazhnuz
3ce567b113 modules/world: floor actor2D position when drawing it 2019-04-28 09:22:31 +02:00
Kazhnuz
ea5011642c modules/world: add a basic solidity system
It'll make easier the solidity system and will reserve custom filter to 
specific objects.
2019-04-25 17:54:51 +02:00
Kazhnuz
75eb198450 modules/world: fix an oops in Actor2D 2019-04-22 12:13:42 +02:00
Kazhnuz
90458757e5 modules/world: make hitbox drawing part of actor 2019-04-22 12:13:01 +02:00