1837.831 days ago
Mar 17, 2018 - 10:08 AM
They told me you had died.
1837.544 days ago
Mar 17, 2018 - 5:01 PM
I'm trying to compile the sample project and I'm getting an error "File must be a CBX file." I didn't modify anything with the build file except adding the directory of the SDK.
Is this a dumb error? Have I embarrassed myself?
1837.312 days ago
Mar 17, 2018 - 10:35 PM
They told me you had died.
Huh?
I'm getting an error "File must be a CBX file."
What exactly did you type to run it and from which directory? Which directory is the .build file in?
1837.216 days ago
Mar 18, 2018 - 12:53 AM
I extracted the project in its own folder called TwoCansSampleProject exactly as it came in the zip and tried to run "crayon TwoCansSampleProject.build" in that folder from the command line. I'm pretty sure I followed exactly what this guide told me to do. What's weird is I did the same thing on my laptop and it compiled just fine.
1836.975 days ago
Mar 18, 2018 - 6:40 AM
HYPE. I like the new API.
I am however confused at a couple steps. I tried adding the crayonpath (pointing to my TwoCansSDK folder) to my existing Reversi project, expecting it to fail to compile since I'm not using the new API. But when I ran "crayon.exe .\Reversi.build", it ran just fine.
I'm also confused at this step:
- Click Upload new version
- Go back to the project page and refresh the page until compilation completes.
What should we be uploading? I arbitrarily tried compiling the sample project and uploading output/UntitledGame.cbx. But now it's stuck in the compiler queue. 🙁 Did I break everything?
1835.143 days ago
Mar 20, 2018 - 2:39 AM
I didn't leave the compiler running this morning, but you need to upload a zip of the source code. I'll update the instructions when I get home from work and restart the compiler service.
Also, right now the Game/Graphics2D libraries are allowed. Soon, I'll be banning them so the game will have to be written with the TwoCans API exclusively.
1835.112 days ago
Mar 20, 2018 - 3:23 AM
Gotcha. I love replacing my own code with standardized libraries (less stuff for me to maintain), and it seems I can eliminate my input manager and color type. 👍
Looks like I missed the compiler boat again though. 😢 Is it running on a machine that's not always online or something?
1834.423 days ago
Mar 20, 2018 - 7:55 PM
Yes, now that the runner is a little more stable, I need to set up the laptop I don't pack up and carry around to run this. Sometimes it'll just crash in the middle of the night.
1834.131 days ago
Mar 21, 2018 - 2:55 AM
Is the compiler ported to Crayon yet?
1833.798 days ago
Mar 21, 2018 - 10:55 AM
That probably won't happen for a while. There's two major projects preventing me from doing that:
- Adding C as a target for export (otherwise there will still be awkward dependencies)
- Adding a new frontend language that compiles to the same bytecode. This new language will likely be a clean subset of C# such that I can still use the VS debugger for development and there will be little to no changes to the actual compiler codebase.
1833.774 days ago
Mar 21, 2018 - 11:29 AM
Is there (or will there be) a replacement for the functionality of Graphics2DText? I.e., is there any way to render text with the TwoCans SDK?
1833.407 days ago
Mar 21, 2018 - 8:18 PM
Not yet.
I'm a little afraid of throwing in a bunch of functionality without designing it properly since API's are hard to change. I'm currently migrating one of my more complicated former PyWeek games to use the TwoCans API as a test to make sure that it's actually useful and not wonky to use. I'll be completing that this weekend.
1833.071 days ago
Mar 22, 2018 - 4:22 AM
From error message:
source/main.cry, Line: 1, Col: 1, Unrecognized namespace or library: 'TwoCansAlpha1'
?
1831.459 days ago
Mar 23, 2018 - 7:03 PM
From the server or when running locally?From the server!
Fix imminent. Fixed.I reset the compilation status on the last version you uploaded.
It is now ready for public consumption.
1831.123 days ago
Mar 24, 2018 - 3:08 AM
Couple of major things I'm planning on doing soon:
- Changing the TwoCans API. I'm starting to realize that radically diverging from the built-in API's is probably not a good idea, since basically it becomes 2 API's I have to maintain and online references would be like JavaScript where there's always a jQuery answer and a normal JavaScript answer. I'm going to wrap the Game/Gamepad API's, but allow direct access to the Graphics2D and Audio libraries. This especially makes converting non-TwoCans to TwoCans difficult. Since I chose the scene management approach for the SDK, what I'll do is still include it as an optional (and highly encouraged library) for those writing code from scratch directly for TwoCans.
- I'm going to change the build file format from XML to JSON. This has been a pain point for a while, and it seems like the sort of change that's better to fix now than before too many people start creating projects.
1831.092 days ago
Mar 24, 2018 - 3:52 AM
Cool! Is the compiler server up still? I want to upload a better version.
And 👍 for JSON!
1831.047 days ago
Mar 24, 2018 - 4:56 AM
It is right now, but it's still the laptop I carry around, so there are sometimes periods of radio silence.
1830.904 days ago
Mar 24, 2018 - 8:22 AM
Would it be possible to specify the window size in the build file or something? It's currently hard-coded at 640 x 480. (I actually want to reduce the window size, in case you're worried I'll explode the forum formatting.)
1816.378 days ago
Apr 7, 2018 - 9:01 PM
Yeah, I can do that.
From the new API:
const SCREEN_WIDTH = $var['screen_width'] ?? 640;
const SCREEN_HEIGHT = $var['screen_height'] ?? 480;
...
width = Math.floor(SCREEN_WIDTH);
height = Math.floor(SCREEN_HEIGHT);
if (width > 640|| height > 480) throw new InvalidArgumentException("Game screen size must be smaller than 640 x 480 to fit site UI");
if (width < 256|| height < 224) throw new InvalidArgumentException("This screen size is too small");
if (width / height < .5) throw new InvalidArgumentException("This screen size is too tall.");
if (width / height > 2) throw new InvalidArgumentException("This screen size is too wide.");
This will be in TwoCansAlpha2, which will remove all layer silliness and just rely on Graphics2D calls directly.
1816.213 days ago
Apr 8, 2018 - 12:58 AM
TwoCansAlpha2 SDK is now out! Same download links. Documentation has been updated. Sample project has been updated as well.
Notably layers have been removed entirely. Just make calls to the built in Graphics2D and Graphics2DText libraries.
1816.169 days ago
Apr 8, 2018 - 2:01 AM
Another couple pretty-please feature requests for the SDK:
1) Access to mouse input via the inputManager (as opposed to only through events)
2) A function that reports whether a given key/mouse button was pressed this frame
Currently we have to keep track of which buttons were pressed last frame if we want to do something upon a button press.
1815.175 days ago
Apr 9, 2018 - 1:53 AM
New TwoCansAlpha2 SDK uploaded! I didn't change the name/version, but it has these new methods in InputManager.
New InputManager methods:
- isKeyPressedThisFrame(key) --> boolean
- isKeyReleasedThisFrame(key) --> boolean
- getMousePosition() --> returns coordinates as a list of two integers
- isMouseOver(left, top, width, height) --> boolean, true if mouse is over the given rectangle
- didMouseClickHere(left, top, width, height) --> boolean, true if mouse clicked in the rectangle in the current frame
Old methods are still there:
- isKeyPressed(key) --> boolean
- isShiftPressed() --> boolean
- isCtrlPressed() --> boolean
1793.116 days ago
May 1, 2018 - 3:17 AM
Games is now one of the main links at the top of the page. It lists all the games that have a public version.
1793.049 days ago
May 1, 2018 - 4:54 AM
I greatly anticipate playing them. Will you add the old ones to that section?
1792.632 days ago
May 1, 2018 - 2:55 PM
{
"thread_id": "10041",
"posts": [
{
"id": "977633",
"time": "1521281294",
"html": "<a href=\"https://twocansandstring.com/dev/howto\">All information moved here!</a>",
"user": "blake"
},
{
"id": "977637",
"time": "1521306080",
"html": "They told me you had died.",
"user": "chetmanly"
},
{
"id": "977649",
"time": "1521326102",
"html": "I'm trying to compile the sample project and I'm getting an error "File must be a CBX file." I didn't modify anything with the build file except adding the directory of the SDK.<br /><br />Is this a dumb error? Have I embarrassed myself?",
"user": "eric616"
},
{
"id": "977656",
"time": "1521334395",
"html": "<div style=\"margin:20px; background-image:url(/images/light.png);\"><div style=\"border:1px solid #888; padding:5px;\"><a href=\"/users/chetmanly\">Chet Manly</a> said:</div><div style=\"border:1px solid #888; padding:20px;\">They told me you had died.</div></div>Huh?<br /><br /><div style=\"margin:20px; background-image:url(/images/light.png);\"><div style=\"border:1px solid #888; padding:5px;\"><a href=\"/users/eric616\">Eric-616</a> said:</div><div style=\"border:1px solid #888; padding:20px;\">I'm getting an error "File must be a CBX file."</div></div><br />What exactly did you type to run it and from which directory? Which directory is the .build file in?",
"user": "blake"
},
{
"id": "977662",
"time": "1521355243",
"html": "I extracted the project in its own folder called TwoCansSampleProject exactly as it came in the zip and tried to run "crayon TwoCansSampleProject.build" in that folder from the command line. I'm pretty sure I followed exactly what this guide told me to do. What's weird is I did the same thing on my laptop and it compiled just fine.",
"user": "eric616"
},
{
"id": "977809",
"time": "1521513562",
"html": "HYPE. I like the new API.<br /><br />I am however confused at a couple steps. I tried adding the crayonpath (pointing to my TwoCansSDK folder) to my existing Reversi project, expecting it to fail to compile since I'm not using the new API. But when I ran "crayon.exe .\\Reversi.build", it ran just fine.<br /><br />I'm also confused at this step:<br /><div style=\"margin:20px; background-image:url(/images/light.png);\"><div style=\"border:1px solid #888; padding:5px;\"><a href=\"/users/blake\">Blake</a> said:</div><div style=\"border:1px solid #888; padding:20px;\"><br /><ul><li> Click Upload new version</li><li> Go back to the project page and refresh the page until compilation completes.</li></ul></div></div><br />What should we be uploading? I arbitrarily tried compiling the sample project and uploading output/UntitledGame.cbx. But now it's stuck in the compiler queue. \ud83d\ude41 Did I break everything?",
"user": "hydrogen777"
},
{
"id": "977813",
"time": "1521516226",
"html": "I didn't leave the compiler running this morning, but you need to upload a zip of the source code. I'll update the instructions when I get home from work and restart the compiler service.<br /><br />Also, right now the Game/Graphics2D libraries are allowed. Soon, I'll be banning them so the game will have to be written with the TwoCans API exclusively.",
"user": "blake"
},
{
"id": "977915",
"time": "1521575721",
"html": "Gotcha. I love replacing my own code with standardized libraries (less stuff for me to maintain), and it seems I can eliminate my input manager and color type. \ud83d\udc4d<br /><br />Looks like I missed the compiler boat again though. \ud83d\ude22 Is it running on a machine that's not always online or something?",
"user": "hydrogen777"
},
{
"id": "977932",
"time": "1521600943",
"html": "Yes, now that the runner is a little more stable, I need to set up the laptop I don't pack up and carry around to run this. Sometimes it'll just crash in the middle of the night.",
"user": "blake"
},
{
"id": "977948",
"time": "1521629729",
"html": "Is the compiler ported to Crayon yet?",
"user": "gws"
},
{
"id": "977955",
"time": "1521631788",
"html": "That probably won't happen for a while. There's two major projects preventing me from doing that:<br /><br /><ul><li> Adding C as a target for export (otherwise there will still be awkward dependencies)</li><li> Adding a new frontend language that compiles to the same bytecode. This new language will likely be a clean subset of C# such that I can still use the VS debugger for development and there will be little to no changes to the actual compiler codebase.</li></ul>",
"user": "blake"
},
{
"id": "978026",
"time": "1521663513",
"html": "Is there (or will there be) a replacement for the functionality of Graphics2DText? I.e., is there any way to render text with the TwoCans SDK?",
"user": "hydrogen777"
},
{
"id": "978058",
"time": "1521692562",
"html": "Not yet. <br /><br />I'm a little afraid of throwing in a bunch of functionality without designing it properly since API's are hard to change. I'm currently migrating one of my more complicated former PyWeek games to use the TwoCans API as a test to make sure that it's actually useful and not wonky to use. I'll be completing that this weekend.",
"user": "blake"
},
{
"id": "978232",
"time": "1521831798",
"html": "<div style=\"margin:20px; background-image:url(/images/light.png);\"><div style=\"border:1px solid #888; padding:5px;\">From error message:</div><div style=\"border:1px solid #888; padding:20px;\">source/main.cry, Line: 1, Col: 1, Unrecognized namespace or library: 'TwoCansAlpha1'</div></div>?",
"user": "hydrogen777"
},
{
"id": "978246",
"time": "1521860897",
"html": "<span style=\"text-decoration:line-through;\">From the server or when running locally?</span><br /><br />From the server! <span style=\"text-decoration:line-through;\">Fix imminent.</span> <span style=\"font-weight:bold;\">Fixed.</span><br /><br />I reset the compilation status on the last version you uploaded. <a href=\"https://twocansandstring.com/uploads/crayonbinaries/p6pm42qmr69p0fccz43sqb9uwnolkx/index.html\">It is now ready for public consumption</a>.",
"user": "blake"
},
{
"id": "978248",
"time": "1521863552",
"html": "Couple of major things I'm planning on doing soon:<br /><ul><li> Changing the TwoCans API. I'm starting to realize that radically diverging from the built-in API's is probably not a good idea, since basically it becomes 2 API's I have to maintain and online references would be like JavaScript where there's always a jQuery answer and a normal JavaScript answer. I'm going to wrap the Game/Gamepad API's, but allow direct access to the Graphics2D and Audio libraries. This especially makes converting non-TwoCans to TwoCans difficult. Since I chose the scene management approach for the SDK, what I'll do is still include it as an optional (and highly encouraged library) for those writing code from scratch directly for TwoCans. </li><li> I'm going to change the build file format from XML to JSON. This has been a pain point for a while, and it seems like the sort of change that's better to fix now than before too many people start creating projects.</li></ul>",
"user": "blake"
},
{
"id": "978249",
"time": "1521867406",
"html": "Cool! Is the compiler server up still? I want to upload a better version.<br /><br />And \ud83d\udc4d for JSON!",
"user": "hydrogen777"
},
{
"id": "978257",
"time": "1521879770",
"html": "It is right now, but it's still the laptop I carry around, so there are sometimes periods of radio silence.",
"user": "blake"
},
{
"id": "979217",
"time": "1523134870",
"html": "Would it be possible to specify the window size in the build file or something? It's currently hard-coded at 640 x 480. (I actually want to <span style=\"font-style:italic;\">reduce</span> the window size, in case you're worried I'll explode the forum formatting.)",
"user": "hydrogen777"
},
{
"id": "979222",
"time": "1523149091",
"html": "Yeah, I can do that.<br /><br />From the new API:<br /><div style=\"text-align:left;background-color:#e8e8e8;padding:12px;-moz-border-radius:8px;border-radius:8px;font-family:"Courier New", monospace;overflow:auto;\"><div style=\"color:#000;\">const SCREEN_WIDTH = $var[<span style=\"color:#a88;\">'screen_width'</span>] ?? 640;<br />const SCREEN_HEIGHT = $var[<span style=\"color:#a88;\">'screen_height'</span>] ?? 480;<br /><br />...<br /><br />width = Math.floor(SCREEN_WIDTH);<br />height = Math.floor(SCREEN_HEIGHT);<br /> <br /><span style=\"color:#00f;\">if</span> (width > 640|| height > 480) <span style=\"color:#00f;\">throw</span> <span style=\"color:#00f;\">new</span> InvalidArgumentException(<span style=\"color:#a88;\">\"Game screen size must be smaller than 640 x 480 to fit site UI"</span>);<br /><span style=\"color:#00f;\">if</span> (width < 256|| height < 224) <span style=\"color:#00f;\">throw</span> <span style=\"color:#00f;\">new</span> InvalidArgumentException(<span style=\"color:#a88;\">\"This screen size is too small"</span>);<br /><span style=\"color:#00f;\">if</span> (width / height < .5) <span style=\"color:#00f;\">throw</span> <span style=\"color:#00f;\">new</span> InvalidArgumentException(<span style=\"color:#a88;\">\"This screen size is too tall."</span>);<br /><span style=\"color:#00f;\">if</span> (width / height > 2) <span style=\"color:#00f;\">throw</span> <span style=\"color:#00f;\">new</span> InvalidArgumentException(<span style=\"color:#a88;\">\"This screen size is too wide."</span>);</div></div><br /><br />This will be in TwoCansAlpha2, which will remove all layer silliness and just rely on Graphics2D calls directly.",
"user": "blake"
},
{
"id": "979223",
"time": "1523152872",
"html": "TwoCansAlpha2 SDK is now out! Same download links. Documentation has been updated. Sample project has been updated as well. <br /><br />Notably layers have been removed entirely. Just make calls to the built in Graphics2D and Graphics2DText libraries.",
"user": "blake"
},
{
"id": "979263",
"time": "1523238798",
"html": "Another couple pretty-please feature requests for the SDK:<br /><br />1) Access to mouse input via the inputManager (as opposed to only through events)<br />2) A function that reports whether a given key/mouse button was pressed this frame<br /><br />Currently we have to keep track of which buttons were pressed last frame if we want to do something upon a button press.",
"user": "hydrogen777"
},
{
"id": "981916",
"time": "1525144663",
"html": "New TwoCansAlpha2 SDK uploaded! I didn't change the name/version, but it has these new methods in InputManager.<br /><br />New InputManager methods:<br /><ul><li> isKeyPressedThisFrame(key) --> boolean</li><li> isKeyReleasedThisFrame(key) --> boolean</li><li> getMousePosition() --> returns coordinates as a list of two integers</li><li> isMouseOver(left, top, width, height) --> boolean, true if mouse is over the given rectangle</li><li> didMouseClickHere(left, top, width, height) --> boolean, true if mouse clicked in the rectangle in the current frame</li></ul><br />Old methods are still there:<br /><ul><li> isKeyPressed(key) --> boolean</li><li> isShiftPressed() --> boolean</li><li> isCtrlPressed() --> boolean</li></ul>",
"user": "blake"
},
{
"id": "981923",
"time": "1525150486",
"html": "Games is now one of the main links at the top of the page. It lists all the games that have a public version.",
"user": "blake"
},
{
"id": "981990",
"time": "1525186519",
"html": "I greatly anticipate playing them. Will you add the old ones to that section?",
"user": "stephven"
}
],
"users": {
"blake": {
"name": "Blake",
"key": "blake",
"url": "/users/blake",
"avatar": "/uploads/drawn/16553.png",
"rankClass": "webmaster",
"rankText": "Webmaster",
"posts": "3033"
},
"chetmanly": {
"name": "Chet Manly",
"key": "chetmanly",
"url": "/users/chetmanly",
"avatar": "/uploads/drawn/25770.png",
"rankClass": "civilian",
"rankText": "",
"posts": "393"
},
"eric616": {
"name": "Eric-616",
"key": "eric616",
"url": "/users/eric616",
"avatar": "/uploads/drawn/7815.png",
"rankClass": "civilian",
"rankText": "",
"posts": "3125"
},
"hydrogen777": {
"name": "Hydrogen777",
"key": "hydrogen777",
"url": "/users/hydrogen777",
"avatar": "/uploads/drawn/11933.png",
"rankClass": "admin",
"rankText": "Admin",
"posts": "7562"
},
"gws": {
"name": "gws",
"key": "gws",
"url": "/users/gws",
"avatar": "/uploads/drawn/29928.png",
"rankClass": "civilian",
"rankText": "",
"posts": "5797"
},
"stephven": {
"name": "Stephven",
"key": "stephven",
"url": "/users/stephven",
"avatar": "/uploads/drawn/12235.png",
"rankClass": "civilian",
"rankText": "",
"posts": "2021"
}
},
"page_num": 1,
"locked": 0,
"total_pages": 2
}