Closed aismann closed 11 months ago
i suggest the template to be a separate repo so you can clone it separately. command line tool should clone from github too. this would reduce repo size further
actually code not affect repo size significant. it's binary files which already removed when rebase axmol main repo.
I think builtin template should as simple as possibile. if there are rich samples need be referenced, just add to related list
I think builtin template should as simple as possibile. if there are rich samples need be referenced, just add to
related list
Good point. I close this issue
other suggestions:
better code to avoid all the #ifdef
s or make it more clear.
here make a function to return the size so there is just something like
director->setContentScaleFactor(getScaleFactor());
instead of if/else if/else in main function
I think builtin template should as simple as possibile. if there are rich samples need be referenced, just add to
related list
I completely agree with this, so please don't add anything more to the template. It's just meant to be the minimum amount of files (and code) in order to be the starting point for a project; anything more than that would mean experienced developers have to clean it up before using it, and new developers to Axmol may be overwhelmed by the contents of the new project.
2. Maybe a redesign of the folder structure like on [axmol-game-demo](https://github.com/paulocoutinhox/axmol-game-demo)
Just one further thing to add, which may be more of an issue for newer developers. That project you linked has some questionable coding practices (such as usage of using namespace
in header files), which would cause problems for developers who may not be experienced enough to spot such problems early on. So, while it may look like a good clean demo project, it doesn't necessarily mean it's the right one to be showing new developers.
My suggestions:
if(ptr) {}
for pointer check, because it is more like cxx: https://learn.microsoft.com/en-us/cpp/extensions/nullptr-cpp-component-extensions?view=msvc-170#example-nullptr-keywordI agree with not filling the template with new things, but everything I'm putting in is what any user will have to do in a real project.
I want rename the files like below: => Is this ok for you?
Nice :) Too much better.
First shot:
??? what is this?
maybe this one is better:
In my opinion, the AXMOL is better, because it is more generic and is not related to what template was used. More generic is better.
Further improvements:
Content
folder can not be found.At the moment when the Content
folder can't be located the screen is empty and just black. The real problem is that when compiling in release the console does not appear by default (does it in Debug?), the user doesn't know what is going on. Ideally the label would use a system font
(like this?)
auto label = Label::createWithSystemFont("Content folder could not be found", "Arial", 24)
It works correctly on windows, but I'm unsure about other platforms.
this:
auto sprite = Sprite::create("HelloWorld.png"sv);
if(sprite != nullptr)
{}
can be rewritten much cleaner as:
if (auto sprite = Sprite::create("HelloWorld.png"sv))
{}
There are a few improvements by using this syntax
sprite
is reduced to only the if/else block(s) which is a good practicesprite
can be used later in the function, avoiding sprite1
, sprite2
etc.You might say it is not important, but the template code is the first interaction with the engine for many new users. Therefore it should truly be as good as possible
* Put all comments in a single line and lowercased, because every comment has one pattern (The sentences are strange and broken, so someone commented anyway)
I respectfully disagree with this suggestion. Yes, the current comments are not "strange", but the more appropriate fix would be to follow convention and the proper structure of a written language, which is to indicate the start of a sentence by capitalizing the first letter of the first word. Having a lower-case word at the start of a sentence implies that it is a continuation of sentence above it. The only time a lower-case letter would make sense is if it were some camel-case identifier in the code that is being used at the start of that sentence in the comment etc.
* Don't break the code, put the full line in a single line, like this: https://github.com/axmolengine/axmol/blob/dev/templates/cpp-template-default/Source/AppDelegate.cpp#L86C9-L87
An assumption cannot be made that everyone uses large/wide screens while programming, so using the example you linked, that would actually slow down the ability absorb what is on that screen, since it's breaking the flow of reading the information by forcing the reader to scroll right. At the moment, the engine has a clang-format with a line width limit of 120, which is reasonable enough, and it only applies to engine source code.
Once a new project is created from the template, what format the developer wants to use for their project is entirely up to them. This would be enabled by implementing your suggestion of having default clang-format, editorconfig and such files in that template that the developer can adjust to suite their style and coding conventions.
This is the new "view" on VisualStudio for 'HelloWorld' Maybe 'AxmolLogo.png' is better? New "HelloWorld" look:
@halx99 is this ok for you?
This is the new "view" on VisualStudio
I don't understand the context. What exactly has changed?
This is the new "view" on VisualStudio
I don't understand the context. What exactly has changed?
Its the summery of all changes on file names and VS project names
Its the summery of all changes on file names and VS project names
I don't quite understand the "VS project names" change. Do you mean that you want to call the generated project "CPPTemplate" regardless of what name is passed to the axmol new ....
command? Or, do you mean you want to change the "cpp-template-default" to "CPPTemplate" in the engine source?
Why not use more generic names, like Logo.png
instead of Axmol.png
. I think that more generic is better.
Its the summery of all changes on file names and VS project names
I don't quite understand the "VS project names" change. Do you mean that you want to call the generated project "CPPTemplate" regardless of what name is passed to the
axmol new ....
command? Or, do you mean you want to change the "cpp-template-default" to "CPPTemplate" in the engine source?
axmol new ....
makes allways the name which is part of the command
'CPPTemplate' (replacing HelloCpp;) is created with CMakeList.txt:
# add cpp-template-default into project(axmol) for tmp test
add_test_target(CPPTemplate ${_AX_ROOT}/templates/cpp-template-default )
axmol new ....
makes allways the name which is part of the command'CPPTemplate' is created with CMakeList.txt:
# add cpp-template-default into project(axmol) for tmp test add_test_target(CPPTemplate ${_AX_ROOT}/templates/cpp-template-default )
Oh! I understand what you mean now.
axmol new ....
makes allways the name which is part of the command 'CPPTemplate' is created with CMakeList.txt:# add cpp-template-default into project(axmol) for tmp test add_test_target(CPPTemplate ${_AX_ROOT}/templates/cpp-template-default )
Oh! I understand what you mean now.
I need the 'OK' from @halx99 for further work
why change to CppTemplate, the HelloCpp
is fine
why change to CppTemplate, the
HelloCpp
is fine
1) In my "first time" with engine-x
I wondered where the HelloCpp
comes from.
=> Thats clearer now for beginnner (in my point of view)
2) Hello World
is still there as label
@halx99
If you want HelloCpp
again, I'll change it again
at least, the lua/cpp templates can be merge into a single template.
at least, the lua/cpp templates can be merge into a single template.
Maybe. I think its not so easy (different CMakeList.txt, and some more different) => Im not so familiar with Lua.
@halx99 First step for this is merge the current PR for CPP. Maybe another more Lua expert can than start to make a single template for CPP/Lua. What are you mean? For Lua Im out.
i put my comments on pr
closed
For a better (cpp) template let us find some improvements:
1) Changing
class HelloWorld
toclass HelloWorldScene
. 2) Maybe a redesign of the folder structure like on axmol-game-demoAnything missed there? Everybody proposal is welcome.