Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 48 49 [50] 51 52 ... 796

Author Topic: if self.isCoder(): post() #Programming Thread  (Read 887559 times)

Max White

  • Bay Watcher
  • Still not hollowed!
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #735 on: January 21, 2012, 12:33:42 am »

I would also be loosing an IDE that almost programs for me. Java has acceptable downgrades, but I haven't yet found anything for python that comes even close to the levels of win that visual studio does casually.

Nadaka

  • Bay Watcher
    • View Profile
    • http://www.nadaka.us
Re: if self.isCoder(): post() #Programming Thread
« Reply #736 on: January 21, 2012, 01:02:38 am »

Well I was going to make this awesome roguelike library in Java because I wanted the cross platform support, be nice to the linux users and all that, but fuck it, I'm done here.
Moving back to c#, Java needs to get its pants off its head and act like a grown up language. I'm not asking for it to be as serious as its father c++, but if little brother c# can handle this shit, I expect the same.

Well. The designers of JAVA were hardcore about doing things a very specific way, heavily enforcing safety and expectation in code. It isn't that JAVA couldn't do it, it is that it was intentionally made that way.  C# intentionally filed off those sharp corners, but they lost a lot of performance, security and cross platform ability in the process.
Logged
Take me out to the black, tell them I ain't comin' back...
I don't care cause I'm still free, you can't take the sky from me...

I turned myself into a monster, to fight against the monsters of the world.

Max White

  • Bay Watcher
  • Still not hollowed!
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #737 on: January 21, 2012, 01:05:30 am »

So what is so unsafe about generic arrays?

Nadaka

  • Bay Watcher
    • View Profile
    • http://www.nadaka.us
Re: if self.isCoder(): post() #Programming Thread
« Reply #738 on: January 21, 2012, 01:12:01 am »

So what is so unsafe about generic arrays?

It is explained in that link I provided.
Logged
Take me out to the black, tell them I ain't comin' back...
I don't care cause I'm still free, you can't take the sky from me...

I turned myself into a monster, to fight against the monsters of the world.

Max White

  • Bay Watcher
  • Still not hollowed!
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #739 on: January 21, 2012, 01:27:33 am »

It just strike me... How does an ArrayList work in Java then?

MagmaMcFry

  • Bay Watcher
  • [EXISTS]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #740 on: January 21, 2012, 07:06:29 am »

People of this forum, I have a problem. As you might know by now, I have quite insane amounts of programming knowledge, both broad and deep.
BUT, there seems to be absolutely nothing I do with it. School doesn't count, as the stuff I have to do there poses absolutely no challenge at all, except for finding any kind of documentation to the weird server software we're currently taking apart.
So I challenge you to challenge me. Give me any game concept (awesome is and I'll try to implement it in C++ to the best of my motivation. The game should probably focus on gameplay, not graphics, because I tend to rate games based on gameplay (see DF), and I won't learn how to use OpenGL because I rather want to focus on knowledge application. I can handle SDL and SFML, so 2d graphics won't be a problem.

Ever had a totally awesome game idea and wished there was a game based on this idea? I am your fucking wish.
Logged

Max White

  • Bay Watcher
  • Still not hollowed!
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #741 on: January 21, 2012, 07:37:28 am »

How about make a good roguelike library in Java, with full color console, keyboard input, mouse support, and maybe some trimmings like height map gen?

Nadaka

  • Bay Watcher
    • View Profile
    • http://www.nadaka.us
Re: if self.isCoder(): post() #Programming Thread
« Reply #742 on: January 21, 2012, 07:56:36 am »

That sounds a lot like whbat I was going to do, though I was looking to ise opengl for accelerated graphic tilesets and the potential for sprites and isometric.
Logged
Take me out to the black, tell them I ain't comin' back...
I don't care cause I'm still free, you can't take the sky from me...

I turned myself into a monster, to fight against the monsters of the world.

GlyphGryph

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #743 on: January 21, 2012, 10:23:41 am »

FryMan's promises are LIES.
Logged

Nadaka

  • Bay Watcher
    • View Profile
    • http://www.nadaka.us
Re: if self.isCoder(): post() #Programming Thread
« Reply #744 on: January 21, 2012, 11:23:46 am »

Re: java

I am stopped at a gas station so I don't really have access to references but :
I believe the ArrayList performs an explicit cast on an insert and uses an array of Objects internally. The reason that java can not be changed easilly for explicit generic arrays like c# can is that by design operator overloading is impossible and you would have to overload [] the dereferencing operator to suport that feature.

As for the example code from max, since your generic implements an interface, you can make the array typed with the interface instead.
Logged
Take me out to the black, tell them I ain't comin' back...
I don't care cause I'm still free, you can't take the sky from me...

I turned myself into a monster, to fight against the monsters of the world.

rmblr

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #745 on: January 21, 2012, 11:32:32 am »

Yup that's right about Java's ArrayList.

Here it is straight from the source code:

Code: [Select]
/**
 * The array buffer into which the elements of the ArrayList are stored.
 * The capacity of the ArrayList is the length of this array buffer.
 */
private transient Object[] elementData;
Logged

Stargrasper

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #746 on: January 21, 2012, 05:08:16 pm »

Wait, the conversation turned to my field (Java) when I wasn't looking?  How did that happen?  I really need more free time to look at this thread...
Logged

Ghills

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #747 on: January 21, 2012, 05:23:33 pm »

People of this forum, I have a problem. As you might know by now, I have quite insane amounts of programming knowledge, both broad and deep.
BUT, there seems to be absolutely nothing I do with it. School doesn't count, as the stuff I have to do there poses absolutely no challenge at all, except for finding any kind of documentation to the weird server software we're currently taking apart.
So I challenge you to challenge me. Give me any game concept (awesome is and I'll try to implement it in C++ to the best of my motivation. The game should probably focus on gameplay, not graphics, because I tend to rate games based on gameplay (see DF), and I won't learn how to use OpenGL because I rather want to focus on knowledge application. I can handle SDL and SFML, so 2d graphics won't be a problem.

Ever had a totally awesome game idea and wished there was a game based on this idea? I am your fucking wish.

An RPG where I never have to kill anyone.  Violence is never the answer.   The player can RP as a businessperson and run a business (complete with enforced compliance with irritating local cultural laws! The best part of any business. :) )  or a charity or whatever.

I'd be happy to volunteer for testing & documentation for this if you don't want to do that.
Logged
I AM POINTY DEATH INCARNATE
Ye know, being an usurper overseer gone mad with power isn't too bad. It's honestly not that different from being a normal overseer.
To summarize:
They do an epic face. If that fails, they beat said object to death with their beard.

Aqizzar

  • Bay Watcher
  • There is no 'U'.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #748 on: January 21, 2012, 05:55:17 pm »

Yo, Max or anybody.  I'm trying to implement some of that superclass stuff (C#) from a few pages back, and I'm running into something I didn't see addressed.  I'm setting up a superclass that PlayerObject and a MobObject will both inherit from, and I'm setting up methods that will take their superclass as input and draw from common primitives in them.  I.E.

Code: [Select]
public abstract class Mob
{
public abstract string referential;

public abstract byte final_minHit;
public abstract byte final_maxHit;
}

public class MobObject : Mob
{
public string referential;

public byte final_minHit;
public byte final_maxHit;
}

Without the "abstract", it says they're hidden by the objects themselves, and when I try to call on those variables even though they're assigned in the MobObject constructor, I get blank data.  I can provide screenshots attesting to this.  When I added "abstract" to all of them, as one would for methods, it won't compile, saying "The modifier 'abstract' is not valid on fields. Try using a property instead. (CS0681)".

So, what am I supposed to be doing here?
Logged
And here is where my beef pops up like a looming awkward boner.
Please amplify your relaxed states.
Quote from: PTTG??
The ancients built these quote pyramids to forever store vast quantities of rage.

Max White

  • Bay Watcher
  • Still not hollowed!
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #749 on: January 21, 2012, 06:13:00 pm »

Do you remember in the example I posted, the abstract class (AIType) had an instance of Critter? Not only was it not abstract, but the subtypes had access to it.

I think you want this.
Code: [Select]
public abstract class Mob
{
public string referential;

public byte final_minHit;
public byte final_maxHit;
}

public class MobObject : Mob
{

}
Pages: 1 ... 48 49 [50] 51 52 ... 796