feat: rock
This commit is contained in:
parent
20fac9423e
commit
7c07653f4a
181
fixtures/rock.entity.json
Normal file
181
fixtures/rock.entity.json
Normal file
|
@ -0,0 +1,181 @@
|
||||||
|
{
|
||||||
|
"traits": {
|
||||||
|
"behaved": {
|
||||||
|
"params": {
|
||||||
|
"contextTypeHints": {
|
||||||
|
"item": "entity",
|
||||||
|
"projectile": "entity",
|
||||||
|
"wielder": "entity"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"collider": {
|
||||||
|
"params": {
|
||||||
|
"isSensor": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"existent": {
|
||||||
|
"state": {
|
||||||
|
"name": "Rock"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"item": {
|
||||||
|
"params": {
|
||||||
|
"cooldown": 0.33,
|
||||||
|
"itemActions": {
|
||||||
|
"type": "actions",
|
||||||
|
"traversals": [
|
||||||
|
{
|
||||||
|
"type": "traversal",
|
||||||
|
"steps": [
|
||||||
|
{
|
||||||
|
"type": "key",
|
||||||
|
"key": "context"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "key",
|
||||||
|
"key": "add"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "invoke",
|
||||||
|
"args": [
|
||||||
|
{
|
||||||
|
"type": "literal",
|
||||||
|
"value": "projectile"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "traversal",
|
||||||
|
"steps": [
|
||||||
|
{
|
||||||
|
"type": "key",
|
||||||
|
"key": "item"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "key",
|
||||||
|
"key": "spawn"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "invoke",
|
||||||
|
"args": [
|
||||||
|
{
|
||||||
|
"type": "literal",
|
||||||
|
"value": "rock"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "traversal",
|
||||||
|
"steps": [
|
||||||
|
{
|
||||||
|
"type": "key",
|
||||||
|
"key": "projectile"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "key",
|
||||||
|
"key": "context"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "key",
|
||||||
|
"key": "add"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "invoke",
|
||||||
|
"args": [
|
||||||
|
{
|
||||||
|
"type": "literal",
|
||||||
|
"value": "wielder"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "traversal",
|
||||||
|
"steps": [
|
||||||
|
{
|
||||||
|
"type": "key",
|
||||||
|
"key": "wielder"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "traversal",
|
||||||
|
"steps": [
|
||||||
|
{
|
||||||
|
"type": "key",
|
||||||
|
"key": "projectile"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "key",
|
||||||
|
"key": "isBehaving"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"value": {
|
||||||
|
"type": "literal",
|
||||||
|
"value": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"slotImageUris": {
|
||||||
|
"default": "/rock.png"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"layered": {},
|
||||||
|
"listed": {},
|
||||||
|
"magnetic": {},
|
||||||
|
"mobile": {},
|
||||||
|
"physical": {},
|
||||||
|
"pictured": {
|
||||||
|
"params": {
|
||||||
|
"images": {
|
||||||
|
"initial": {
|
||||||
|
"offset": [
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"size": [
|
||||||
|
12,
|
||||||
|
12
|
||||||
|
],
|
||||||
|
"uri": "/rock.png"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"positioned": {},
|
||||||
|
"roomed": {},
|
||||||
|
"shaped": {
|
||||||
|
"params": {
|
||||||
|
"shape": {
|
||||||
|
"type": "rectangle",
|
||||||
|
"position": [
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"size": [
|
||||||
|
12,
|
||||||
|
12
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"spawner": {
|
||||||
|
"params": {
|
||||||
|
"spawns": {
|
||||||
|
"rock": {
|
||||||
|
"uri": "/rock-projectile.entity.json"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"visible": {}
|
||||||
|
}
|
||||||
|
}
|
|
@ -9,7 +9,7 @@ const decorate = compose(
|
||||||
contempo(require('./entity.raw.scss')),
|
contempo(require('./entity.raw.scss')),
|
||||||
);
|
);
|
||||||
|
|
||||||
const json = require('~/../fixtures/mama-kitty.entity.json');
|
const json = require('~/../fixtures/rock.entity.json');
|
||||||
|
|
||||||
const EntityComponent = (props) => {
|
const EntityComponent = (props) => {
|
||||||
const entity = new Entity(json);
|
const entity = new Entity(json);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user