-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Level declaration syntax #12
Comments
I guess the best way would be to remove the lambda function parsing and executing as an array and instead preparse the declaration from e.g.
|
I am always a fan of c function-ifying things, and I do prefer the ChangeCell(4,4,60,GOAL); syntax - but this is only a mild preference! You have a much deeper understanding of these language constructs than I do, and have no reason to question your judgment on these sorts of things!!! This is all that comes to mind: (1) We could do our own preprocessor on the TCC to add language features not in TCC. For this sort of thing, lambda functions would be extremely useful. (2) The only reasons I was/am using TCC are: (a) Binding to the rest of the engine is trivial - it is very easy to export a vast array of useful functions. (b) Object orientation doesn't really matter when it comes to a very flat environment. It's just an array of blocks. (c) It does not increase compile time. (d) Simply saving the file can reload-in-place. --- So, don't completely abandon the idea of using a scriptier thing. |
I just realized that using a syntax like
Maybe a better approach would be to first write a ingame/external level editor, that would make these things less important. but I don't think I have the energy for that right now ;) |
I've compiled TCC manually for a number of platforms, I may be able to compile libtcc1.a into the project. Actually, I'm going to have access to a Windows computer soon, so I can mess around on there. Someone else on youtube asked about the level editor, and I don't think it would be that hard. I'll make an issue for that and think about doing it over the next few days. |
Lua is nice, that's pretty simple to interface. |
I have tried doing the LUA thing, but it never really panned out for me. If you want to take a stab at it again, I would be up for poking with that branch. |
Currently the levels are declared in a kind of DSL. I'm not sure if there is a better way / different syntax.
Also this means that the RunScript/InitScript parts have a different syntax because they are C.
The syntax of script and static things should be joined. Maybe put the static things back into normal C, not parsed extra?
Or maybe the other way around, preparse the C to make it more readable and easily allow things like Block Type aliases.
The text was updated successfully, but these errors were encountered: