Draco18s
6860 posts
|
Topic: Game Programming /
Deeper Topic (part 2): Composition over inheritance
This is something I have to start doing myself. I know how to use it, but when starting a new project I inevitably don’t set my class structure up in a way that supports it.
|
|
|
Draco18s
6860 posts
|
Topic: Game Programming /
Jumping with more than 1 in a for loop?
Originally posted by Drakim:
No problem.
And for future reference, you can do this with more than just the plus operator:
x += 5;
y -= 6;
z *= 2;
a /= 3;
And more than just the basic four
a ^= b; //used it. a is set to a bitwise-XOR b
a <<= b; //seen it. a is set to a*Math.pow(2,b)
a >>= b; //seen it. reverse of the previous.
a %= b; //used it. a is set to the remainder of integer division of a / b
a &= b; //pretty sure this works. a is set to a bitwise-AND b
a |= b; //pretty sure this works. a is set to a bitwise-OR b
|
|
|
Draco18s
6860 posts
|
Topic: Game Programming /
How Do You Pronounce...
care, vair, jay-son (the son of Jay), ee-sea-em-ay script, HACKS!, you-int, swiff, swick, flaw.
|
|
|
Draco18s
6860 posts
|
Topic: Game Programming /
Logical OR help
Originally posted by BobJanova:
AS3 doesn’t have a logical XOR operator
Yes it does: !=
That is not XOR, that’s NOT.
Edit, just realized how you were using that.
if(x < 0 != x > 100) {
//executes if x is less than 0 XOR x is greater than 100
}
You’re essentially causing the program to evaluate both sides, then compare them to each other.
|
|
|
Draco18s
6860 posts
|
|
|
|
Draco18s
6860 posts
|
Topic: Game Programming /
HOW DO YOU LINK POWERUPREWARDS TO THIS
Did you try the giant, flashing, “LINK YOUR ACCOUNTS” button on this page?
Which I got to by using the top-navigation:
Achievements → Score Powerup Rewards
|
|
|
Draco18s
6860 posts
|
|
|
|
Draco18s
6860 posts
|
Topic: Game Programming /
Minecraft - Find nearby block ID's
I haven’t done any entity tracking myself.
|
|
|
Draco18s
6860 posts
|
Topic: Game Programming /
Minecraft - Find nearby block ID's
World world; //this is likely passed to the function this code will exist in, probably updateTick
int x, y, z; //also passed to the function
for(int i = -5; i <= 5; i++) {
//ditto j and k for a 3D loop
int blockID = world.getBlockId(x+i, y+j, z+k);
//whatever you need to do with that block ID
}
Also, the Minecraft Forge forums will be more useful.
|
|
|
Draco18s
6860 posts
|
Topic: Game Design /
Game genres - Is there anything new under the sun?
In 2007, a game called Flash Element Tower Defense created a new sub-genre of strategy games called Tower Defense.
TDs date back farther than that, but FETD was the first stand-alone game in that genre. That is, if you don’t count Ramparts as being a part of the genre.
|
|
|
Draco18s
6860 posts
|
Topic: Game Design /
'Were You A Nineties Gamer?' post-mortem
Sigh, internet indeed.
Halo 1 came out on Nov 15, 2001.
|
|
|
Draco18s
6860 posts
|
Topic: Game Design /
Should you ever incentivize players to fail?
There’s a free space team shooter on Steam, forget the title offhand, but my first match I got an achievement for “taking 2x your total health in damage and surviving.”
That is an award that is worth giving people, particularly for a game where you play against other people, as it takes skill (or in my case, being retardedly lucky, as I had no clue what I was doing other than “that giant rock is cover, go there”) to pull off. It’s not a “die 50 times” achievement, it’s “don’t die twice” achievement.
That said, games where you can be expected to die like Amorphous+ are the ones that can have a “die 50 times” achievement and make it work. Simply by playing you are going to die.
|
|
|
Draco18s
6860 posts
|
Topic: Game Programming /
Show us a screenshot of what you're working on!
Originally posted by feartehstickman: Can you copy what a sapling does but invert the trees it generates when it “grows”? Or are saplings also part of world generation?
I can copy that, but why? That doesn’t make for an effect that slowly destroys the world.
Originally posted by Vixivo:
Test 4
An odd rope that you can drag around.
Sorry for such a long post. Heh-heh.
Looks like you’re multiplying the force applied to each section by a value greater than one, which causes each segment to move farther than the previous segment, not less.
|
|
|
Draco18s
6860 posts
|
Topic: Game Programming /
Show us a screenshot of what you're working on!
Originally posted by feartehstickman:
Upside down growing trees?
You keep thinking of a collection of blocks as a single object. “Trees” in minecraft are handled by a world gen function. A single function call that determines what shape to make the tree and place all of the wood blocks.
I can use one block to place multiple other blocks, but I can’t make things “grow” like trees as I have limited ability to determine the location of other blocks (I have to specifically request “what block is at position (x,y,z)?” and then figure out if it’s a block I care about, and what to do with that information).
|
|
|
Draco18s
6860 posts
|
Topic: Game Programming /
Show us a screenshot of what you're working on!
Originally posted by feartehstickman:
Make a block which generates mushroom clouds of a random size.
Can’t think of any other ideas…
That’s not how this works.
You forget that all the blocks are acting the same way.1 They have different metadata which can change the behavior, but growing mushroom clouds is not feasible. Or useful (or detrimental).
1 Blocks are not instanced in minecraft! The map is actually more like a giant array of integers, and the game iterates through the ones that are getting updates, looks up their class (by the integer stored there) and determines what happens by running functions in the singleton.
|
|
|
Draco18s
6860 posts
|
Topic: Game Programming /
Show us a screenshot of what you're working on!
Originally posted by Ace_Blue:
No need to be such a stickler. It’s programming for a game so it fits in the forum, it contains pictures and they are pictures of what the poster is currently working on, so they fit the thread as well. Besides, self-replicating structures are cool.
Not to mention I’m having a fcukign blast.
The maze block now takes a material modifier (Mystcraft plugin symbol pages hoodoo), as well:

In this case, iron ore.
|
|
|
Draco18s
6860 posts
|
Topic: Game Programming /
Show us a screenshot of what you're working on!
Ah, what the heck.




I’ve been making self-replicating1 blocks in Minecraft that do all kinds of awful, terrible things to the landscape. The last one (the gif) is a block that spreads across the landscape (the black blocks, the texture is in debug mode) and then the central area plays a game of Life using the rules B3/S1234 with slight modifications. When the design stabilizes, it creates unbreakable bedrock walls from the surface all the way down to the bottom of the map, occasionally creating towers and such on the surface.
Project thread
1 Strictly speaking, most of them don’t “gray goo.” I just mean that they spread in various manners and cause various kinds of destruction.
|
|
|
Draco18s
6860 posts
|
Topic: Game Programming /
Best way to know what your doing?
Best way to know what your doing?
Do it, and fail. Learn your limits.
|
|
|
Draco18s
6860 posts
|
Topic: Game Programming /
Health Bar
Originally posted by Draco18s:
Or this
^ Tutorial.
It uses AS2 in the code snippets, but it’s like 8 lines and trivial to convert to AS3.
|
|
|
Draco18s
6860 posts
|
Topic: Game Programming /
[Q] Do I Need External Scripts?
Originally posted by Elyzius:
I’m sure there is more than one valid answer to this question, but if I were you, I’d put the moveBall function in Game.as.
Consider this: The ball is not an intelligent object. It does not actively make decisions on where to go based on what its goals are and what paths are available to it.
Consider this: an object should control its own properties and behaviors, for example, a spring may not be intelligent, but it has behaviors that are not externally controlled.
|
|
|
Draco18s
6860 posts
|
Topic: Game Programming /
Windows offers developers $100 per app submitted and accepted into their app store...
Originally posted by UnknownGuardian:
$100 isn’t a lot. Its not even enough to break even for time worked for any reasonable hourly wage. Make sure if you are entering to make money you do so the correct way. That $100 is far short of the potential $$$$ you could be making off the bajillion win8 devices out there currently and in the future.
$100 likely doesn’t even cover the developers license. :V
|
|
|
Draco18s
6860 posts
|
|
|
|
Draco18s
6860 posts
|
Topic: Game Programming /
Health Bar help
You can also use the normal layer mask way, only it stops at set intervals instead of any floating point value.
|
|
|
Draco18s
6860 posts
|
Topic: Game Programming /
How to switch frames in this case?
Best solution:
Make each button a class that has its own on load.
Alternate solution:
Don’t add the events until the button exists (i.e. you change frames)
Note: if you add your event listener for your first button, then change frames, when you come back, that button will not have event listeners anymore.
|
|
|
Draco18s
6860 posts
|
Topic: Game Programming /
Change Combo Box label?
ComboBoxReference.selectedIndex = SomeValue;
The value passed is the index of the label you want (likely one less than the current frame).
|