Re: Best way to learn 2d games with D?

2020-03-17 Thread bauss via Digitalmars-d-learn
On Tuesday, 17 March 2020 at 23:09:32 UTC, Dennis wrote: On Tuesday, 17 March 2020 at 22:47:43 UTC, Sebastiaan Koppe wrote: Dont trust that marketing, there is actually decent scripting in gamemaker, which you'll need if you get creative. Second that. GameMaker is how I got into programming at

Re: Best way to learn 2d games with D?

2020-03-17 Thread Dennis via Digitalmars-d-learn
On Tuesday, 17 March 2020 at 22:47:43 UTC, Sebastiaan Koppe wrote: Dont trust that marketing, there is actually decent scripting in gamemaker, which you'll need if you get creative. Second that. GameMaker is how I got into programming at age 12, and look where I ended up ;)

Re: Best way to learn 2d games with D?

2020-03-17 Thread Sebastiaan Koppe via Digitalmars-d-learn
On Tuesday, 17 March 2020 at 18:55:08 UTC, Steven Schveighoffer wrote: He's done a lot of stuff in Scratch. I taught him and a whole group of other homeschoolers a class on javascript and this year (up until this whole virus thing) we were working in Roblox (lua). So far I try to make the lesso

Re: Best way to learn 2d games with D?

2020-03-17 Thread Steven Schveighoffer via Digitalmars-d-learn
On 3/17/20 2:22 PM, Sebastiaan Koppe wrote: On Tuesday, 17 March 2020 at 15:38:55 UTC, Steven Schveighoffer wrote: It's not something I'm intending to create professionally, really the impetus is my son wanting to do more significant game coding. How old is he? I find something simple like

Re: Best way to learn 2d games with D?

2020-03-17 Thread Sebastiaan Koppe via Digitalmars-d-learn
On Tuesday, 17 March 2020 at 15:38:55 UTC, Steven Schveighoffer wrote: It's not something I'm intending to create professionally, really the impetus is my son wanting to do more significant game coding. -Steve How old is he? I find something simple like gamemaker works well with 12-16 olds.

Re: Best way to learn 2d games with D?

2020-03-17 Thread Steven Schveighoffer via Digitalmars-d-learn
On 3/16/20 11:19 PM, aberba wrote: On Tuesday, 17 March 2020 at 03:13:02 UTC, aberba wrote: On Sunday, 15 March 2020 at 17:58:58 UTC, Steven Schveighoffer wrote: I want to try and learn how to write 2d games. I'd prefer to do it with D. I've found a ton of tutorials on learning 2d gaming with

Re: Best way to learn 2d games with D?

2020-03-17 Thread Dennis via Digitalmars-d-learn
On Sunday, 15 March 2020 at 17:58:58 UTC, Steven Schveighoffer wrote: I want to try and learn how to write 2d games. I'd prefer to do it with D. I haven't seen anyone mention Dgame yet: https://github.com/Dgame/Dgame It's not maintained anymore since last November [1], but is seems pretty ma

Re: Best way to learn 2d games with D?

2020-03-17 Thread Jan Hönig via Digitalmars-d-learn
I made a similar search two months ago as well. I recommend a simple library. I landed with https://code.dlang.org/packages/raylib-d It is supposed to be for learning how to do 2d games. It is easy to work with, which was my main search parameter. I need to figure out the logic, physics, client-s

Re: Pattern matching via switch?

2020-03-17 Thread Steven Schveighoffer via Digitalmars-d-learn
On 3/17/20 8:04 AM, rikki cattermole wrote: On 18/03/2020 12:59 AM, Steven Schveighoffer wrote: I think he's looking for object pattern matching. i.e. you give it an Object, and it runs a block of code based on the derived type. In case this syntax is unknown: if (MyObject1 myObject = cast(My

Re: Pattern matching via switch?

2020-03-17 Thread rikki cattermole via Digitalmars-d-learn
On 18/03/2020 12:59 AM, Steven Schveighoffer wrote: I think he's looking for object pattern matching. i.e. you give it an Object, and it runs a block of code based on the derived type. In case this syntax is unknown: if (MyObject1 myObject = cast(MyObject1)obj) { ... } else if (MyObjec

Re: Pattern matching via switch?

2020-03-17 Thread Steven Schveighoffer via Digitalmars-d-learn
On 3/17/20 4:18 AM, Paolo Invernizzi wrote: On Sunday, 15 March 2020 at 18:52:01 UTC, Steven Schveighoffer wrote: D doesn't support this natively. The closest you can get is something akin to what aliak wrote (you would need to write something, not sure if Phobos or some package has implemente

Re: b.content.x - get property of ...structure|class|...

2020-03-17 Thread Виталий Фадеев via Digitalmars-d-learn
On Tuesday, 17 March 2020 at 09:31:21 UTC, Виталий Фадеев wrote: Main goal is: get content "xywh" from given rect and padding. Of course content.x is dynamic. // import core.sys.windows.windows; import std.stdio; class Base { RECT rect= { 0, 0, 500, 400 }; RECT padding = { 10, 10,

b.content.x - get property of ...structure|class|...

2020-03-17 Thread Виталий Фадеев via Digitalmars-d-learn
Main goal is: get content "xywh" from given rect and padding. Of course content.x is dynamic. // import core.sys.windows.windows; import std.stdio; class Base { RECT rect= { 0, 0, 500, 400 }; RECT padding = { 10, 10, 10, 10 }; // ...content... ??? content { @pro

Re: Pattern matching via switch?

2020-03-17 Thread Paolo Invernizzi via Digitalmars-d-learn
On Sunday, 15 March 2020 at 18:52:01 UTC, Steven Schveighoffer wrote: D doesn't support this natively. The closest you can get is something akin to what aliak wrote (you would need to write something, not sure if Phobos or some package has implemented the feature), or use cascaded if statemen