Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Xik
Mar 10, 2011

Dinosaur Gum


It's "done". It's... pretty much not fun at all. You can play it here and view the source code here.

I had fun, learned some Javascript and a bit about the process of making a game. I sort of want to go ahead and actually make a "real" game now. One where I can actually plan and maybe even have make something fun.

e: drat, new page. To apologise for this having to be at the top of the page for a while, check out this commit I made. I've had the flu most of this week and dozed off while watching presentations by Douglas Crockford a couple times. For some reason I got it in my head that the += operator was unsafe and I was purposely not using it. I'm a dumbass.

Xik fucked around with this message at 16:03 on Mar 15, 2014

Adbot
ADBOT LOVES YOU

SupSuper
Apr 8, 2009

At the Heart of the city is an Alien horror, so vile and so powerful that not even death can claim it.

munce posted:

I think its because it takes a huge amount of effort to make the graphics look any good. There's dozens of frames for each character, plus the backgrounds. Even just taking the pre-made graphics out of xcom and putting it into this was a fair amount of work. If you were drawing everything from scratch you would need a really good artist (or art team) that are prepared to work for a long haul. I'm no artist, hence my use of art from someone else's game. Also nostalgia.
To be fair X-COM only had like 2-3 artists, so it's probably more dedication than anything, and you wouldn't need as many sprites if you weren't making a pseudo-3D-isometric game with that style.

kayakyakr
Feb 16, 2004

Kayak is true

Xik posted:



It's "done". It's... pretty much not fun at all. You can play it here and view the source code here.

I had fun, learned some Javascript and a bit about the process of making a game. I sort of want to go ahead and actually make a "real" game now. One where I can actually plan and maybe even have make something fun.

e: drat, new page. To apologise for this having to be at the top of the page for a while, check out this commit I made. I've had the flu most of this week and dozed off while watching presentations by Douglas Crockford a couple times. For some reason I got it in my head that the += operator was unsafe and I was purposely not using it. I'm a dumbass.

hey, did ya know that in javascript, you can also use ++?

Xik
Mar 10, 2011

Dinosaur Gum

kayakyakr posted:

hey, did ya know that in javascript, you can also use ++?

I only use "the good parts" of Javascript as defined by Crockford and run the code through jslint. Using ++ would result in an error. This is why I was confused about +=, for some reason I thought I had read not to use it, something about string concatenating.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Crockford's rationale against ++ is "if I use it, I'm tempted to merge everything into one line".

It's not unsafe or dangerous in any way, it's just Crockford applying his anecdata thinking that avoiding it will somehow make people write better code.

Xik
Mar 10, 2011

Dinosaur Gum
Most of what is in jslint has pretty good reasons for being there, but I'm aware some of the "rules" are just opinions. I'm an amateur, and having an opinionated tool made by an expert that goes through my code line by line is pretty much invaluable. In the best case scenario it catches some error I would have spent ages debugging in the browser, at worst it just keeps the code to a consistent style.

kayakyakr
Feb 16, 2004

Kayak is true
crockford is a crock. don't pollute the global namespace, don't make spaghetti code, keep things reasonably object oriented and you're doing better than 90% of javascript programmers.

Xik
Mar 10, 2011

Dinosaur Gum
I don't think being better then 90% of Javscript programmers is much of an achievement. Why even bother setting the bar at all if you're setting it so low?

If you're an experienced developer and know Javascript really well that's awesome. I'm not. Until I am, and know JS more intimately to know when to break the rules, I'll just follow them. I'm not arrogant enough to think that I know more after a week then someone who has been using it for over a decade.

e:

pokeyman posted:

You're conflating one man's opinion with "rules". Just remember that you're tying your own straitjacket, is all.

Yep, I totally understand that. But the actual "rules" (the official standard) for Javascript is horrible and/or broken. I'm also not working within a team so have no personal mentors to guide me. If this was any other modern, popular language I could just read the official docs/api and just be fine.

Xik fucked around with this message at 03:51 on Mar 16, 2014

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Xik posted:

If you're an experienced developer and know Javascript really well that's awesome. I'm not. Until I am, and know JS more intimately to know when to break the rules, I'll just follow them. I'm not arrogant enough to think that I know more after a week then someone who has been using it for over a decade.

You're conflating one man's opinion with "rules". Just remember that you're tying your own straitjacket, is all.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

Xik posted:

Yep, I totally understand that. But the actual "rules" (the official standard) for Javascript is horrible and/or broken. I'm also not working within a team so have no personal mentors to guide me. If this was any other modern, popular language I could just read the official docs/api and just be fine.

If that's your opinion of Javascript (it's the correct opinion to have too!), then perhaps Javascript is not the ideal language for you to gain experience in?

As penance for language-chat, here are some pics from an old project that I'm starting to update to C++11:

shrughes
Oct 11, 2008

(call/cc call/cc)

Suspicious Dish posted:

Crockford's rationale against ++ is "if I use it, I'm tempted to merge everything into one line".

It's not unsafe or dangerous in any way, it's just Crockford applying his anecdata thinking that avoiding it will somehow make people write better code.

Yes it is unsafe. Why do you think Crockford has this opinion? Why do you think it only works on its own line in Go? Its use passed through some refactoring caused a security bug in Tarsnap. You're the problem, willfully using things you find "convenient" like some scrub.

But wait does Crockford seriously use += 1 in for loops or on its own line?

shrughes fucked around with this message at 12:11 on Mar 16, 2014

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

shrughes posted:

Yes it is unsafe. Why do you think Crockford has this opinion? Why do you think it only works on its own line in Go? Its use passed through some refactoring caused a security bug in Tarsnap. You're the problem, willfully using things you find "convenient" like some scrub.

I pretty much only use ++ on its own line. My issue isn't the operator, it's that he's basing a gigantic rule to the language on his own gut and opinion, rather than actual data.

It might be that ++ is actually horrible, so I'd love to see some data. Got a link to the Tarsnap bug?

shrughes posted:

But wait does Crockford seriously use += 1 in for loops or on its own line?

Yes. And jslint enforces that. No ++, ever.

Tres Burritos
Sep 3, 2009

Suspicious Dish posted:

Got a link to the Tarsnap bug?

http://www.daemonology.net/blog/2011-01-18-tarsnap-critical-security-bug.html ?

shrughes
Oct 11, 2008

(call/cc call/cc)
Sorry if my comment came off as attacking, I meant it more as self parody or a recording of my natural reaction to such a post.

The best thing about the CTR bug was how on HN tptacek had warned cperciva of this very thing in multiple arguments about what chaining modes to recommend.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Thanks for the link.

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

kayakyakr posted:

crockford is a crock. don't pollute the global namespace, don't make spaghetti code, keep things reasonably object oriented and you're doing better than 90% of javascript programmers.

You have to be super careful when flinging terms like "object oriented" around with javascript - it has a lot of features that simulate those you'd find in an object oriented language, but the combination of dynamic typing, lack of "interface" construct and poor exception handling make it a poor choice for large scale projects. Stuff like Dart, Typescript and the Google Closure compiler make an attempt at mitigating these issues, but the language inherently is weak for OOP.

kayakyakr
Feb 16, 2004

Kayak is true

Bruegels Fuckbooks posted:

You have to be super careful when flinging terms like "object oriented" around with javascript - it has a lot of features that simulate those you'd find in an object oriented language, but the combination of dynamic typing, lack of "interface" construct and poor exception handling make it a poor choice for large scale projects. Stuff like Dart, Typescript and the Google Closure compiler make an attempt at mitigating these issues, but the language inherently is weak for OOP.

Which is why I say, "reasonably object oriented". There are a bunch of ways you can do this from attaching things to objects to node-style module exports. Personally, I like doing prototypal objects inside closure scopes.

You and I probably wouldn't agree when it came to attributing an importance to some of these features or lack thereof. For example, I'm on the side of liking dynamic typing for the most part.

But you hit it on the head when you mention large-scale projects. JS is good for client side stuff and good for small webservers, but it's certainly not appropriate for much beyond that.

Marsol0
Jun 6, 2004
No avatar. I just saved you some load time. You're welcome.
Playing with A* Pathfinding. I've been messing with pathfinding for the last few weeks, but this is the first time I add a visual component to it outside of printing to the console.



Source
Runnable JAR

Lurchington
Jan 2, 2003

Forums Dragoon

Suspicious Dish posted:

Yes. And jslint enforces that. No ++, ever.

It's all about JSHint anyway. A little more balanced of an approach (See attached)

Only registered members can see post attachments!

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Yep. Don't use JSLint, it's bad. Xik would probably be better off hearing that, though.

Tres Burritos
Sep 3, 2009

Lurchington posted:

It's all about JSHint anyway. A little more balanced of an approach (See attached)

I see it has some plugins for Sublime Text 3, my job atm is pretty much 100% javascript. How worthwhile would picking this up / learning this be?

Deus Rex
Mar 5, 2005

I thought I'd learn a little Emacs Lisp and port Dark Souls to it :q:

https://www.youtube.com/watch?v=Sv1OS7bOrIQ

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

Bruegels Fuckbooks posted:

You have to be super careful when flinging terms like "object oriented" around with javascript - it has a lot of features that simulate those you'd find in an object oriented language, but the combination of dynamic typing, lack of "interface" construct and poor exception handling make it a poor choice for large scale projects.
I am confused about how the first half of this sentence is related to the second half. You appear to be using a definition of OO that excludes Smalltalk.

Lurchington
Jan 2, 2003

Forums Dragoon

Tres Burritos posted:

I see it has some plugins for Sublime Text 3, my job atm is pretty much 100% javascript. How worthwhile would picking this up / learning this be?

In my opinion, there are two places where it's worth taking the time setting up a "linter" (a generic term for something that enforces coding style best practices by failing the build):
- your office has a continuous integration and build environment where multiple developers are checking things in, and want the agreed-upon style enforced
- you personally want to make sure you're using best practices and you're the only one who touches stuff

if this applies to you, I think it's worth setting up something like jshint and fixing the things it tells you to do.

Surface
May 5, 2007
<3 boomstick

Lurchington posted:


- your office has a continuous integration and build environment where multiple developers are checking things in, and want the agreed-upon style enforced


This, via Grunt, with Bower + NPM + Travis/Jenkins, is a special kind of bliss.

Add SASS + AngularJS + some kind of AMD into the mix and suddenly developing JS webapps is almost sane.

Woodsy Owl
Oct 27, 2004
I've been working on my duplicate file detector/scanner application for a while now and I was designing the UI around Java's Nimbus look and feel. But it was rubbing me the wrong way and the UI wasn't intuitive or user-friendly at all, so I've been working on some custom Swing components that complement Java's default Metal look and feel pretty well. I guess my components could be considered a skin for Metal, so I've named it Oxide because whatever.

Anyway, I'm in the progress of migrating and implementing my Oxide components. So far it looks like this:



The goal is for cross-platform compatibility which I hope to accomplish by reaching some aesthetic compatibility with Java's native look and feel.

edit: In the progress window the yellow progress indicator icon is actually animated like this: . My goal when designing the progress indicators was to match the Oxide/Metal aesthetic with respect to their minimalism.

Woodsy Owl fucked around with this message at 04:36 on Mar 17, 2014

Shalinor
Jun 10, 2002

Can I buy you a rootbeer?
Video sunday? I always miss screenshot saturday. But hey, videos!

Finally got video of the new Franky AI. It's surprisingly fun to play with, and the Creepy Watson teleporting both fits the theme and is an awesome in-joke/reference.

https://www.youtube.com/watch?v=WlR6kjPk9qA

... and here's the final ammo and ammo box and all that art. The gum drop rounds and the catnip rounds are especially cool.

https://www.youtube.com/watch?v=CHJ8ztqe_38

Also, we're finally in production mode, so I can start showing off actual levels. I'm really happy with how the drawbridge and torches worked out. It's all graybox, but you get the idea.

https://www.youtube.com/watch?v=MXQBYUZIT78

Programmer Humor
Nov 27, 2008

Lipstick Apathy
Is there a reason you load individual bullets rather than just selecting a weapon? Will there be puzzles that involve loading the correct sequence? It just seems it might get old kinda quickly.

Shalinor
Jun 10, 2002

Can I buy you a rootbeer?

Programmer Humor posted:

Is there a reason you load individual bullets rather than just selecting a weapon? Will there be puzzles that involve loading the correct sequence? It just seems it might get old kinda quickly.
Yes, there will be puzzles that require pretty particular loadouts. Or, rather, there will be quite a few loadouts that are useful for different reasons, and each puzzle will be designed to interact with some subset of them. I'm already finding loadouts that are too complex to require in regular gameplay, but will end up being core to speedrunning/sequence breaking - tricks that could never have been done with traditional weapon-per-power setups.

As for the why - because hey, why not? I've played a ton of games where you find the freeze gun and the burn gun and the (etc), but I've never played a game that lets you customize and then rapid-fire a combo of all of the above. That, and the revolver angle fits noir well. EDIT: The revolver was actually the very first element we built around, the whole game grew out of an experimental gun system that I threw some shadow'y lights and a fedora into for funsies.

As far as the reload being annoying, we'll probably add a quick-reload that keeps your currently load intact / just refreshes the bullets. That'll be nice for traversals et al that just need a lot of the same thing.

Shalinor fucked around with this message at 18:53 on Mar 17, 2014

Literally Elvis
Oct 21, 2013




Still not as interesting as the voxel generators and such posted here regularly, but here goes:

My first shot at an Android app. I've already made this app in C#/Windows Forms, but I really wanted to try my hand at something mobile. It has been...interesting. I'll say this, doing this app in C#/Visual Studio were WAY easier than Java/Android Studio. It took me a whole of 30 minutes to get everything working more or less, whereas this has taken me a few days.

Part of that is learning the file structure of Android's projects, which is easy enough, but I get this sense that the slightest mistake when editing file X in arbitrary location Y permanently messes up your project, but that's likely just a lot of user error on my part.

Also C#'s number generation is cooler because it lets you set a lower and upper bound, whereas Java only lets you set an upper bound.

Really I just wanted to have something I could point to and say "see, I've done this thing, please don't throw my resume away immediately". This is just the start of that. Lots of work to go.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
That looks great, congrats!

Dren
Jan 5, 2001

Pillbug

Literally Elvis posted:




Still not as interesting as the voxel generators and such posted here regularly, but here goes:

My first shot at an Android app. I've already made this app in C#/Windows Forms, but I really wanted to try my hand at something mobile. It has been...interesting. I'll say this, doing this app in C#/Visual Studio were WAY easier than Java/Android Studio. It took me a whole of 30 minutes to get everything working more or less, whereas this has taken me a few days.

Part of that is learning the file structure of Android's projects, which is easy enough, but I get this sense that the slightest mistake when editing file X in arbitrary location Y permanently messes up your project, but that's likely just a lot of user error on my part.

Also C#'s number generation is cooler because it lets you set a lower and upper bound, whereas Java only lets you set an upper bound.

Really I just wanted to have something I could point to and say "see, I've done this thing, please don't throw my resume away immediately". This is just the start of that. Lots of work to go.

How smart are the fake answers? E.g. 4-12 could include -16, 8, -8, 4 or something to be trickier.

Literally Elvis
Oct 21, 2013

Dren posted:

How smart are the fake answers? E.g. 4-12 could include -16, 8, -8, 4 or something to be trickier.

They're not very smart.

If the actual solution to the problem is less than X, then the random numbers generated for possible answers can't be higher than X + 10, IIRC. I need to come up with a better solution than that, but that was all I could think of in a jiff to make sure the proposed answers for 2 + 2 weren't something like 4, 88, 92, and 61. After X, the max changes to X + (1/2)X. That seems to work well enough for higher numbers, but they don't come up that often anyway, and I wasn't entirely sure I wanted the quiz to be hard, per se.

There are, however, basic checks against division (and modulo!*) by zero, and when the answer is negative, all possible answers are made negative so that nothing is obviously not that answer.

Now that I think of it, I could have some additional code that gives a chance of one or both operands being negative. That would create some interesting problems.

I also intend to add statistics (time taken per answer, percentage correct, etc.)



*coding this taught me that Z % 0 in Java throws the division by zero exception, which makes sense but wasn't something I had ever thought of.

kayakyakr
Feb 16, 2004

Kayak is true

Literally Elvis posted:

They're not very smart.

If the actual solution to the problem is less than X, then the random numbers generated for possible answers can't be higher than X + 10, IIRC. I need to come up with a better solution than that, but that was all I could think of in a jiff to make sure the proposed answers for 2 + 2 weren't something like 4, 88, 92, and 61. After X, the max changes to X + (1/2)X. That seems to work well enough for higher numbers, but they don't come up that often anyway, and I wasn't entirely sure I wanted the quiz to be hard, per se.

There are, however, basic checks against division (and modulo!*) by zero, and when the answer is negative, all possible answers are made negative so that nothing is obviously not that answer.

Now that I think of it, I could have some additional code that gives a chance of one or both operands being negative. That would create some interesting problems.

I also intend to add statistics (time taken per answer, percentage correct, etc.)



*coding this taught me that Z % 0 in Java throws the division by zero exception, which makes sense but wasn't something I had ever thought of.

To be tricker, you could weight answers to be mostly even if the answer is even and mostly odd if the answer is odd. If 5 is an operand, the answers should all end in 0 or 5. Basically code in the math tricks to make the answers more than just a process of elimination.

bgreman
Oct 8, 2005

ASK ME ABOUT STICKING WITH A YEARS-LONG LETS PLAY OF THE MOST COMPLICATED SPACE SIMULATION GAME INVENTED, PLAYING BOTH SIDES, AND SPENDING HOURS GOING ABOVE AND BEYOND TO ENSURE INTERNET STRANGERS ENJOY THEMSELVES

kayakyakr posted:

If 5 is an operand, the answers should all end in 0 or 5.

Why would this make it harder? 5 + 2 = 7, which does not end in either 0 or 5. That is only true for multiplication.

hendersa
Sep 17, 2006

A bit of rework on the BeagleSNES front-end GUI to make its XML a bit more flexible and modular, and suddenly things like this start popping up:



What? "GBA Title 1"?



Yes.

kayakyakr
Feb 16, 2004

Kayak is true

bgreman posted:

Why would this make it harder? 5 + 2 = 7, which does not end in either 0 or 5. That is only true for multiplication.

Sorry, I meant when 5 is an operand in multiplication.

Xik
Mar 10, 2011

Dinosaur Gum


You can see it live over here, be sure to check out the rainbow one! Here is the Javascript source. Feel free to criticise it.

Doing stuff in the browser is growing on me. I might change my mind once I attempt to tackle a project that is even marginally complicated though.

Pie Colony
Dec 8, 2006
I AM SUCH A FUCKUP THAT I CAN'T EVEN POST IN AN E/N THREAD I STARTED

Bruegels Fuckbooks posted:

You have to be super careful when flinging terms like "object oriented" around with javascript - it has a lot of features that simulate those you'd find in an object oriented language, but the combination of dynamic typing, lack of "interface" construct and poor exception handling make it a poor choice for large scale projects. Stuff like Dart, Typescript and the Google Closure compiler make an attempt at mitigating these issues, but the language inherently is weak for OOP.

What? Prototype based programming IS object oriented programming, and a lack of exceptions/static typing/interfaces doesn't change that (though I agree that it does make large projects harder).

I think prototypical inheritance is kinda neat. It has a certain endearing simplicity (I guess by virtue of eliminating the distinction between class and object) and allows some "cool" things to be done, particularly when combined with dynamic typing. Its main obstacle is organization of objects and code using the objects - there was some research started on this in the 90s but no one really cared and it stopped.

Adbot
ADBOT LOVES YOU

Trabisnikof
Dec 24, 2005

Let me explain to you how there is one true programming language/style/purpose/need and all others are wrong and evil.

I wish my work had pretty screenshots to it yet, instead merging data doesn't really make for pretty pics.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply