Arctenik / astro-snatcher

a browser game (somewhat incomplete)
1 stars 0 forks source link

editing and formats #6

Open Arctenik opened 7 years ago

Arctenik commented 7 years ago

it would probably be nice to have a graphical editor at some point

EDIT: also since the editor will influence the format i'm gonna start talking about that here (that includes script stuff)

Arctenik commented 7 years ago

i think i need to figure out the basics of how the editor will work bc it'll be useful in informing what the level format should be like

Arctenik commented 7 years ago

i would definitely like the level to be rendered with all the objects that are in it initially

Arctenik commented 7 years ago

oh the list of aqua grabber stuff from #8 might be useful for figuring out whats kinds of things i'm aiming to support

Arctenik commented 7 years ago

something i should definitely consider is how exactly objects that DON'T start out in the level should work

oh hmm i guess this won't just be a level editor bc i'll wanna be able to edit standalone objects as well

Arctenik commented 7 years ago

ok so i think maybe there should be two places to define objects one where they're automatically added to the level when it starts running and one where they're not

uh before i continue i should probably mention that i'm thinking that scripts in the editor will be block-based kinda like Scratch

anyway from those two object areas you'll be able to drag out the objects as blocks to insert into scripts and then it'd probably be good if from that block you could add properties to overlay onto the newly-created object maybe there should even be a way to add scripts to run?? idk precisely what the point of that would be though

Arctenik commented 7 years ago

i'm not quite sure how blocks for effects like slideTo should determine what object to use um maybe there should be a menu input where you either select a named object, select "this", or drop in a block that returns an object? i was kinda worried that with "this" it could potentially be unclear what that would refer to but really it'd probably just be the most recent parent object block right?

Arctenik commented 7 years ago

ok i wonder if this has given me enough info to do some stuff with the format

Arctenik commented 7 years ago

sooo i think the level object will have two properties "initObjects" and "reservedObjects" or something whose values will be arrays of JSON objects each of those objects will have a "name" property and an "object" property "name" is a unique name "object" is the actual game object i'm using arrays bc i want to be able to rearrange the objects in the editor

Arctenik commented 7 years ago

oh although i guess that you'll be able to have a "src" property instead of an "object" property which'll be the url of an object json file

Arctenik commented 7 years ago

the level will also have an "images" property which'll be an array of json objects, each of which will have a "name" property and a "src" property

at some point i should probably come up with a way of including external script stuff but i don't think that's really necessary at this moment

Arctenik commented 7 years ago

i said up there that you'd be able to "drag out the objects as blocks" but now i'm thinking it'd be better if instead the object definitions had blocks INSIDE them that you could drag out

Arctenik commented 7 years ago

i think that'll be representing a "copy" effect that takes an object name or actual object value as a parameter and then it'll probably eventually have parameters to set properties and run scripts but i don't think i need to deal with that atm i could probably start implementing this stuff

Arctenik commented 7 years ago

changing the "src" property on object sprites to "image"

Arctenik commented 7 years ago

i'm gonna say that objects aren't technically required to have names but ofc scripts can't do anything with a nameless object

Arctenik commented 7 years ago

so i'm deciding that object json can only be put in those two arrays right? that'll solve at least part of #20

also i said somewhere at some point that objects should all have a "type" property set to "object" but that's unnecessary now in the json

Arctenik commented 7 years ago

hmm i'm not sure if this is the best place to put this but at some point i'll probably have to introduce some sort of namespace system for images bc i don't think i want image names from external objects getting in the way of those in the level or those in other external objects for that matter

Arctenik commented 7 years ago

ok i've implemented some of the changes i mentioned here

Arctenik commented 7 years ago

you know since i've done most of the big interesting stuff, and since i've been moving to thinking about how to make the format do more complex things anyway, maybe this would be a good time to actually MAKE the editor?

Arctenik commented 7 years ago

https://github.com/Zatnik/astro-snatcher-editor

Arctenik commented 7 years ago

so it occurred to me that Tiled exists and it might be worth it to have it be the recommended editor instead of going any further with trying to make my own from scratch

Arctenik commented 7 years ago

currently thinking the layout of a level would be something like this:

i think that those are the main important things OH right and scripts would have to be JavaScript-only, with functions referenced by custom properties in Tiled

Arctenik commented 7 years ago

couple changes: