Recent posts by dragon_of_celts on Kongregate

Flag Post

Topic: Game Programming / GiTD #45 Theme Selection

In honour of the overwhelming response to this thread:
Adj.: Lonely
Noun: Crickets
Verb: Chirping
Game Mechanic: one-button play

 
Flag Post

Topic: Game Programming / Attention idle gme makers..

Well, if you aren’t bothered by the fact that an idle “game” isn’t actually a game, then you shouldn’t be bothered by an idle “game” having more to do than absolutely bugger all…

In any case, this would be much better suited in the Game Design forum.

 
Flag Post

Topic: Game Programming / Bitwise Operations

Originally posted by EndlessSporadic:


Can I test one number to see how many bits are the same as another number?
For example if I took the number 111 (7) and 101 (5) it would output 2 as bit 2^0 is 1 on both numbers and 2^2 is also the same.

Once again in a single operation, no. You would need to compare every bit and keep track yourself.

Bitwise AND (&) should do it.

var1: 00000111 (value 7)
var2: 00001101 (value 13)

result = var1 & var2; // bitwise AND
// result: 00000101 — matching bits

(I used 13 instead of 5 just so both numbers had bits to “mask out”; I thought it gave a more thorough example — the resulting value would be the same either way)

Edit: That will tell you which bits match, but it won’t tell you how many bits match. I think that’s what EndlessSporadic meant when he said you’d have to compare each bit and keep track. ActionScript doesn’t appear to have a way to save shifted off bits, so you’d need to mask all but the least significant bit (of the & result), test (increment counter if 1), right shift, and repeat until the entire int is evaluated:

var testmask:Number = 1  // to mask all but the least-significant bit
var testcounter:int = 32;   // number of bits to test (number of bits in an int) 
var matchcount:int = 0;
do
{
  var bittester:int = result & testmask;
  if (bittester > 0)
  {
    ++matchcount;
  }
  result >>= 1;
  --testcounter;
} while (testcounter > 0);

…something like that…

 
Flag Post

Topic: Game Design / Some ideas for crafting/weapons

Obsidian was used for arrowheads by the indians, as it gives relatively easy (very) sharp edges and is light weight (I can’t recall now, though, whether the arrowheads were lighter or heavier than similarly-sized bone arrowheads). It may have been used for some other weapons in other cultures, but as far as I understood the indians mostly just used it for arrowheads. I’m not certain, but I think that is probably because large pieces would tend to shatter, so using it as a [hunting] knife (for example) would be risky. Might want to research that a bit…

Shaping rock is difficult, particularly without metal tools. Some rocks produce better edges than others, but most rocks are very heavy. Bone, on the other hand, is light, many times already shaped for weapon use (fangs, horns, claws, some ribs), and light. A club or hammer would definitely prefer rock (or a tomahawk), whereas a fast attack weapon (such as a dagger(-ish)) would likely prefer bone (or just wood, if it is hard enough).

Sinew could be used for bow strings (or plant fibre), affixing heads onto spears (or leather) — assuming the spears have separate heads (fire-hardened wood was also used), or the feathers onto arrows or blowdarts.

Originally posted by ArcStudios:

And I might funnel the player into being increasingly more powerful and only concentrating on gathering resources for newer weapons by providing player with a “spirit” version of each weapon that cannot be lost or destroyed or run out of ammo as they play the game.

Well, unless the player is going to need excessive amounts of materials, or the materials are hard to get, I’m not sure that this won’t be detrimental to having a crafting system. Having materials drop all over the place but only be useful on rare occasions actually feels worse than scrounging for materials (to me, anyway). Keep in mind you’re only talking about 5 different weapons (six if you include some kind of dagger, and 8 if you include ammo) — though all of them could have different versions, as you say. Others can weigh in on this, hopefully, and tell you if they feel the same.

 
Flag Post

Topic: Game Design / Some ideas for crafting/weapons

OK, so original posts were changed/deleted while I was responding. Now my response seems kind of weird…

Things other than rocks and sticks to collect:
Bone. Obsidian (volcanic glass formed as igneous rock, so I don’t know if you included this with “rocks”). Some form of vines, grass, or sinew for binding or bow strings, perhaps?

Originally posted by ArcStudios:

Things like leather or any materials that you wouldn’t just pick up off the ground would require me to add ways to process those items, which I don’t feel fits my design very well.

Well, considering that rocks and sticks are extremely unlikely to be picked up off the ground in a form immediately usable for weaponry, I don’t really see much of a difference. Kill an animal, get leather and/or bone. Or, if you don’t like that, maybe have a village/“shop” to transform collected animals to leather?

More complex and better items could be blocked until player has crafted enough of a particular type of item (gained enough skill at crafting).

I don’t know if those were the type of suggestions you were looking for…

 
Flag Post

Topic: Game Programming / AS3 help - removeChild of a different class

Anything that is a descendant of DisplayObject, which includes the ToolBar class, has a property called visible, which you can set to true or false. As you can probably imagine, setting it to false will make it not show up on screen.

 
Flag Post

Topic: Game Programming / AS3: Syntax error

Originally posted by player_03:
Originally posted by dragon_of_celts:

There’s no such thing as “!==”

That’s the strict inequality operator.

Oh, yes. Thanks, I stand corrected. Now that you mention it, I vaguely recall that popping up some time ago (and obviously I forgot).

 
Flag Post

Topic: Game Programming / AS3: Syntax error

There’s no such thing as “!==”; it is either “!=” or “==” (for “is not equal to” or “is equal to” comparison, respectively) — though as revenant___ says, it doesn’t make any sense for it to be “!=”, because it will always evaluate to true (unless you change the || to &&).

Originally posted by darkjonas8:

Im still having problems with the

if (level1data[j] !== 1){
part, i want to check what collumn a specific element is (the element at [i][j]), how would i do that?

Wait, so it’s a double-array?
To check the contents of a double-array (assuming you’re checking for “does not contain the value 1”, and that you have set the ints i and j to the correct indeces):

if (level1data[i][j] != 1)
{
  // do whatever
}

Please note that your subsequent checks for “not 0 or 2” should also follow the same form.

I also assume that the level1data double-array contains simple numeric values, correct (you aren’t attempting to access a property of an object contained inside the double-array)?

 
Flag Post

Topic: Game Programming / GiTD Timing

I probably won’t be around for theme selection at the end of November, but other than that its OK…

 
Flag Post

Topic: Game Programming / GiTD #44 - *Contrats I_love_you_lots/dragon_of_celt s*

I_love_you_lots and dragon_of_celts are neck-and-neck! Who will win the prestigious GiTD #44 contest? Everyone’s so excited they forgot to vote!

Originally posted by Shalmezad:

Voting ends October 4th at 9PM EST (later than previously announced due to a major US holiday and start of school for some people)

Uh… What major US holiday? The only “major” holiday in October I can think of off the top of my head is Halloween (which isn’t really “major” in my book, but the potential for time-consuming holiday shenanigans is fairly high, so I guess it’s “major” in that respect — but it’s at the end of the month, so it doesn’t really factor in). I even Googled “October holidays”, but didn’t get anything noteworthy.

 
Flag Post

Topic: Game Programming / [Solved] Serialization sucks - HALP!

Take a look at the comment and answer at the bottom of this page, regarding using IExternalizable to circumvent object serialization problems. Not sure if it will help you, but might be worth a try.

Just out of curiosity, do you serialize multi-dimensional Vectors anywhere else (ChapterData has aRegionData double-Vector)?

 
Flag Post

Topic: Game Programming / GiTD #44 - *Contrats I_love_you_lots/dragon_of_celt s*

Well, my first- and second-place votes go to I_love_you_lots. ;)

Just as a pre-emptive comment:
Cat Jihad
Sacred – well, they are supposed to be sacred stones that you’re protecting; but you can call anything “sacred”, so it’s kind of weak.
Territory – you’re protecting your territory, I suppose, but that’s even weaker than the excuse for “sacred”.
Helping – You can heal your allies (and if they moved, they could heal you, too) and empower the shrines, so maybe it qualifies.
Turn-based – complete fail

So overall adherence to the theme is abysmally low (in my defense, the original game I was working on actually met all of the above — though “sacred” would be unchanged).

Known issues:
No proper end (needs refresh)
Pushing not implemented (and no pits to push into)
Allies don’t do anything
No HP or XP indicators
Allies not repositioned after selection phase, so Brute is under the blank HUD

 
Flag Post

Topic: Game Programming / GiTD #44 Theme Suggestions

Originally posted by Shalmezad:
Originally posted by dragon_of_celts:

Cat Jihad

Right as I was typing the finale post.

Well, since you caught me before I clicked submit:

That concludes GiTD #44. Voting thread will be up shortly.

Fast SWF didn’t seem to want to let me upload it for some reason. It took me something like 6 or 7 tries.

Wow. Only two entries… and one being my pathetic crippled one. Well, I guess expanding the theme didn’t do much to help participation… or anything, really.

 
Flag Post

Topic: Game Programming / GiTD #44 Theme Suggestions

OK, so this isn’t at all what I was originally working on, and it’s nowhere near complete, but…:

Cat Jihad

I was working on a game heavily influenced by Monster Tap, which satisfied all of the theme elements (including being turn-based). Had a bit of a problem that I didn’t think I could take care of in time, so I scrambled to make Cat Jihad…

Pushing doesn’t work yet, and there’s only one enemy: the Rountwit… and your allies don’t do anything right now.

Click to move (when selected cat-thing is ready). You’ll do more damage if you bump into Rountwits when in attack mode (you go into attack mode when you click on or near a Rountwit). You’re supposed to protect the shrine stones from them… After killing some enemies, you can (theoretically) transfer some XP to a shrine stone by touching it. Once enough XP is transferred, the shrine stone will become warm. When the enemies touch the shrine stones, they drain warmth. If they get very cold (dark), it will take twice as much XP to warm them. If you can get a shrine stone to critical mass, it will light up, and any XP you have when touching it will go toward leveling you up and increasing your stats. Unfortunately, I didn’t get around to XP and HP indicators, so you’re playing blind.

If the allies were functional, you could heal them when they are wounded and vice-versa. Once you’re all knocked out, it’s over (well, not really, as it doesn’t check for that yet).

 
Flag Post

Topic: Game Programming / GiTD #44 Theme Suggestions

Originally posted by I_love_you_lots:

Am I the only one working on an entry?

I am working on one. I hope it will be ready in time (at least a simple version). One day left, but a lot left to do…

 
Flag Post

Topic: The Gate / new event, extended waves

You aren’t getting extra waves at all — the wave counter gets messed up some times. It’s been happening to me for ages.

 
Flag Post

Topic: Game Programming / GiTD #44 Theme Suggestions

Originally posted by dragon_of_celts:

Italicized items have been changed by me (to reflect current contest), and are subject to change by Shalmezad.

Originally posted by Shalmezad:

There’s 3 phases (write down these dates):
Theme selection: Now – September 21st
GiTD #44: September 21st at 9PM EST to September 31st at 9PM EST
Voting: September 31st – October 2nd 9PM EST
Winners announced: October 2nd 9PM EST

I just realized that I didn’t take into account that there are only 30 days in September, so contest end date should actually be October 1st, with voting from the 1st to the 3rd.

 
Flag Post

Topic: Game Programming / [Solved] Input text field acts weird when not put on stage.

I don’t know if this will help at all, but I was having difficulty with TextField cutting off text, and specifically setting it’s autoSize property fixed it (the default is TextFieldAutoSize.NONE, so set it to LEFT, RIGHT, or CENTER).

Here’s Adobe’s page on scrolling text in TextField — I didn’t read through it, but it looks like you have to “roll your own”…

 
Flag Post

Topic: Game Programming / GiTD #44 Theme Suggestions

Originally posted by I_love_you_lots:
Originally posted by Shalmezad:


Game Mechanic: “It’s like standing in the rain without getting wet”

Wait…

…that’s not a game mechanic!

Isn’t it the equivalent of writing “bullet hell”? Alternatively, it could be a repellant or shielding force…

 
Flag Post

Topic: Game Programming / GiTD #44 Theme Suggestions

Well, I assume Shalmezad is busy (I PM’ed, but no response), so I’m just going to put this up here, just in case (since he originally said the contest would start on the 21st). Italicized items have been changed by me (to reflect current contest), and are subject to change by Shalmezad.

Originally posted by Shalmezad:

Ladies and Gentlemen!
Boys and girls of all ages (above 13 years of age due to terms of service)!
Welcome to yet another round of GiTD Theme selection!

So, for those of you who are new:
GiTD is “Game in Ten Days”, where developers from all over the world and different skill sets compete to make the best game they can in ten days while still sticking to the theme.

There’s 3 phases (write down these dates):
Theme selection: Now – September 21st
GiTD #44: September 21st at 9PM EST to September 31st at 9PM EST
Voting: September 31st – October 2nd 9PM EST
Winners announced: October 2nd 9PM EST

Theme selection
This thread is dedicated to the theme selection. Based on feedback recieved here this will go slightly different.

#All suggestions that aren’t extreme will be fed into the RNG.
#The RNG is now set up to pick between nouns, verbs, adjectives, and game mechanics. Your game must include the nouns,verbs, and adjectives that come up. The game mechanics are optional.
#Suggesting old themes is allowed
#The more random the input, the more random the output. You can’t have combustible lemons if life doesn’t give you lemons.

My suggestions for this month:
Noun: Territory
Verb: Capture
Adjective: Shapeshifting
Game Mechanic: resource management

 
Flag Post

Topic: Game Programming / Troubles with Array lenght!

You have “length” misspelled in all cases except for the ‘armo’ element, which is why that’s the only one that returns a proper value.

 
Flag Post

Topic: Game Programming / Troubles with Array lenght!

I believe your compiler thinks that you were actually creating a new Array and initializing it to have one element (containing a reference to LISTS[‘armor’], which has 3 elements). LISTS is a multi-dimensional array already — so I assume I don’t have to explain how that works.

Your trace statement should’ve been:


trace(LISTS[‘armor’].length); //==> 3

You obviously figured it out on your own, as you did exactly that when you called it “array”.

 
Flag Post

Topic: Game Programming / as3 how to detect the edge of a movieclip

That’s OK if you don’t mind the character being halfway off the floor (since character.x is in the centre). Otherwise you’ll need to add or subtract half the character’s width to character.x when you test.

 
Flag Post

Topic: Game Programming / as3 how to detect the edge of a movieclip

Assuming that the character’s registration point is the top left (default):

if (character.x < floor.x)
{
   character.x = floor.x;  
}
else if (character.x + character.width > floor.x + floor.width)
{
   character.x = floor.x + floor.width - character.width;
}

Keep in mind that if the character doesn’t have the same direct parent as floor, that you will need to adjust their coordinates (since they won’t be using the same coordinate space); or, if floor is character’s direct parent, you should remove the “floor.x +” parts of the above code (replace floor.x with 0 on top lines).

 
Flag Post

Topic: Game Programming / Happy Programmers Day!

Well, that’s pretty good, but your code gives two errors:

line 8: A string literal must be terminated before end of line

line 15: artist is never flogged