Recent posts by Shalmezad on Kongregate

Flag Post

Topic: Game Programming / GiTD #42 - *Pirates*

No screenshots, no prototypes, no “I’ve decided to go with a [insert game type here]”.
Starting to get a bit worried.
Maybe making some people walk the plank will cheer me up.

 
Flag Post

Topic: Game Programming / GiTD #42 - *Pirates*

Avast ye landlubbers!
Only 4 more days left. Better get workin’ on your entry, or ye’ll be swabbing the poop deck until next months GiTD!

 
Flag Post

Topic: Game Programming / GiTD #42 - *Pirates*

Originally posted by truefire:

So GitD rules are pretty ambiguous. Am I allowed to reuse old graphical assets? (I have some pirate-and-other-thing sprites I made a while back and never used.)

Since the rules neither allow it, nor disapprove, I’d say it’s allowed this time.
Afterwards, we’ll probably have the discussion on what can be reused, especially since some of us have premade libraries we use, or have reused sprites from other games.

 
Flag Post

Topic: Game Programming / GiTD #42 - *Pirates*

Dead men tell no tales…. or do they?

As usual, going the open source route:
https://github.com/Shalmezad/gitd_pirates

 
Flag Post

Topic: Game Programming / GiTD #42 - *Pirates*

Originally posted by Aesica:
Originally posted by Shalmezad:

(of course, some of you may want to consider that piracy means something completely different now that what it used to)

NO! All games MUST be about looting, plundering and sailing the seven seas, matey! I just hope I can come up with something worthy of the theme. In the meantime, this should help set the mood a bit: http://youtu.be/xDVdo2-JGtg

If I get a song stuck in my head because of this theme, I’m picking llamas next time so I can return the favor.

 
Flag Post

Topic: Game Programming / GiTD #42 - *Pirates*

Sorry for the delay. Typing up a RNG and driving seemed like a horrible idea, so I decided to wait until I got home.

Luckily, the peg-legged eye-patched gods of the RNG have spoken quickly. This GiTD theme is: PIRATES!

(of course, some of you may want to consider that piracy means something completely different now that what it used to)

 
Flag Post

Topic: Game Programming / Sprite Sheet Animation Demo 1.1

Only thing I’d recommend is instead of:
trect.x = themonster.pose * 62;
trect.y = themonster.dir * 56;

Add 2 variables at the top:
const FRAME_WIDTH:Int = 62;
const FRAME_HEIGHT:Int = 56;
And change the code to:
trect.x = themonster.pose * FRAME_WIDTH;
trect.y = themonster.dir * FRAME_HEIGHT;
So it’s clearer where those numbers are coming from.
Other than that, I can see it helping people who are new to sprite sheets. Good tutorial.

Edit: Accidentaly used tile instead of frame. Which leads to the possibility of the next, somewhat related topic you could do: tilemapping.

 
Flag Post

Topic: Game Programming / can u guys tell me whats wrong in this c++ program

Everything above, and a little extra:
Some C++ compilers require that your main function be
int main()
instead of void.

Which means you’d also need a:
return 0;
At the end of your main function.

 
Flag Post

Topic: Game Programming / GiTD #42 - *Pirates*

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 – 7/21/2014 9PM EDT
Theme announced on 7/21/2014 at 9PM EDT
Game development: 7/21/2014 9PM EDT – 7/31/2014 9PM EDT
Voting: 7/31/2014 9PM EDT – 8/02/2014 9PM EDT
Winners announced on 8/02/2014 at 9PM EDT

Theme selection
This thread is dedicated to the theme selection. As a community based contest, the theme selection is highly driven by your suggestions. So post away, and let the games begin!

A couple quick notes
Anything posted here has the possibility to become a theme
Most of the time, I use a RNG so I don’t even know the theme until it’s time
All dates/times are in EDT
I’m holding you to your post I_love_you_lots, so you may want to submit a theme idea

 
Flag Post

Topic: Game Programming / Need Help

Originally posted by EndlessSporadic:

This thread is just another reminder why I despise ActionScript.

Originally posted by EndlessSporadic:

People hate on Unity because most of the games released on it are half-assed shit. I hate on it because it is really unoptimized.

So what programming language/framework do you like/use?

 
Flag Post

Topic: Game Programming / Need Help

Originally posted by Draco18s:
var money = 0;
addEventListener(Event.ENTER_FRAME, doTheThing);
function doTheThing(e:Event) {
money++;
}

I’ll take my cut in cash, thanks.

Probably would be better to use the time difference instead of relying on the EnterFrame event. It’ll help to ensure a consistent rate:

var prevTime= getTimer();
var money = 0;
var moneyPerSecond = 1.0;
addEventListener(Event.ENTER_FRAME, doTheThing);
function doTheThing(e:Event) {
var currTime = getTimer();
var diff = currTime – prevTime;
prevTime = currTime;
money += moneyPerSecond * (diff/1000.0);
}

I’ll take my cut in cash, especially since it allows you to adjust your money per second (such as having more rabbits = more money/second).

 
Flag Post

Topic: Game Programming / graphic design for game implemation with as3 using FlashDevellop

My method in FD:
I had a script that would take a directory, and build an assets.as (using embeds, and giving it the name of the file without the extension).
If you’re going to have a lot of files (which for a tcg is a yes), I’d look into doing something like this.

Or a spritesheet, but then you need some other way (xml, pre-defined array, etc) to do the names.

But, you’ll probably have some sort of card list anyways with titles, stats, whatever, so having a reference to an embedded resource or position in a sprite sheet should be no problem.

 
Flag Post

Topic: Game Programming / Array elements

If you really wanted to, you could override array, and reject anything added once size reaches a max_limit variable (which you would add to your new class).
Or as NineFiveThree mentioned, write a function to keep it in bounds,
Or, add a wrapper class that hides the internal array:

class LimittedArray
{
public var max_size:int = 0;
private var arr:Array = new Array();
public function addElement(o:Object):Bool
{
if(arr.length < max_size)
{
arr.push(o);
return true;
}
return false;
}
//add any other methods you want/need (pop, get, etc)
}

But the real question is why would you want to? AS3 along with most higher languages provide dynamic arrays because we’re no longer exposed to the underworkings where you must allocate N*size bytes for N objects, or where you have to keep track of size, or add a null pointer. If there’s a need to keep it a certain size (ie, only 10 bullets on screen), then it should be the responsibility of the adding code (a shoot function) to check the size (if bullets.size < 10, shoot()).

 
Flag Post

Topic: Game Programming / String conversion

Been a while since I did AS3, but if I recall, AS3 arrays are nice in that they have the push method:

var pressed:Array= new Array();
//In your event listener:
var pressedChar:String = String.fromCharCode(e.charcode);
pressed.push(pressedChar);

Then you can do whatever you want with that array.

If you’re still having issues, post the relevant code you have so far, and we can help you debug it.

Related docs:
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/Array.html#push%28%29
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/String.html#fromCharCode%28%29

 
Flag Post

Topic: Game Programming / how do you add two numbers in c++

Kinda, more or less.
To start with, you don’t need the #include statement unless you’re using something that requires a library (ex: a cout requires iostream).
Which then brings your program to something similar to what you have:

int main(){
int a,b,c;
a=10;
b=10;
c=a+b;
return 0;
}

But, like most people are wondering, why are you asking a simple C++ question here instead of:

  • Looking it up
  • Trying it yourself. Assuming you’re following a book or class, the first thing you learn is how to print stuff out. Write some code, run it, and output the result of c. If it doesn’t work, find out why and fix it. After all, writing the program isn’t even half the battle. Issues will come up, and you’ll need to become good at finding them.
 
Flag Post

Topic: Game Programming / GiTD #41 - *Congratulations Aesica*

Timers are helpful… if you don’t press snooze.
Voting is now over.
The final tally count will come tomorrow, but if I did the math right:
Aesica – 5
Shalmezad – 4
Shake_N_Baker – 3

 
Flag Post

Topic: Game Programming / Simple Zombie AI

Also, a quick glance at you shooting code:
if(counter = delay){
counter = 0;
}

You have a single = in counter = delay. I can 99.9% guarantee that you want counter == delay instead.

 
Flag Post

Topic: Game Programming / Simple Zombie AI

So, given an x, y, angle, and distance (we’ll call it magnitude), you want a move x and move y.

Which means you’ll want something like this:
diffX = cos(angle) * magnitude
diffY = sin(angle) * mangitude

Which you can then add to your current x/y to get your new x/y.

BUT the normal trig directions assume 0 deg = right and 90 deg = up. So you’ll want to do -1 * diffY to account for it.

As for the reason behind it:
You’re basically making a right triangle. diffX/diffY are the legs, magnitude is the hypotenuse, and angle is the angle. Using SohCahToa, you get these equations:
sin(angle) = opposite[diffY] / hypotenuse[magnitude]
cos(angle) = adjasent[diffX] / hypotenuse[magnitude]
Just multiply both sides by the magnitude, and you get your diffX/Y

 
Flag Post

Topic: Game Programming / GiTD #41 - *Congratulations Aesica*

Originally posted by Aesica:
Originally posted by Shalmezad:

Fixed per Aesica’s note.

That’s definitely the wrong one. The version that made it in just before the deadline is the last one I posted in the other thread. This version.

Alright, think I got it this time!

 
Flag Post

Topic: Game Programming / GiTD #41 - *Congratulations Aesica*

Originally posted by dragon_of_celts:

Link to Aesica’s is broken.

Fixed per Aesica’s note.

Shake_N_Baker – Lunar Hex (not listed for some reason):


Also fixed. Really trying to figure out how I missed that.

Sorry, guys, I was actually working on something for this one (well, I kind of started yesterday)… In Haxe 3.


Understandable. Even though haxe + openFL is extremely similar to flash, you really need more than this GiTD to get it down (as I found out last time)

plus I didn’t notice this ended at 9 EST

Then I realized, "9 EST, not 9 PST. Oops.

Sorry guys, it’s been EST since GiTD #37 . Unless you have a nice house for sale on the west coast, it’ll stay like that, so make sure to do the appropriate conversions ahead of time. =)

 
Flag Post

Topic: Game Programming / GiTD #41 - *Congratulations Aesica*

GiTD #41 is finished. Now it’s time to vote!

Theme: Random Generation
Voting will go until 7/3/2014 at 9PM EST, at which time winners will be announced.

Voting Rules:
You must vote for a 1st place and a 2nd Place. The 1st place vote will receive 2 points and the 2nd place vote will receive 1 point. The person with the most points will win. Using alts to vote will result in disqualifications. Remember to make it clear who you are voting for. You cannot vote for yourself.

Past and present participants to the GitD may vote without being questioned, but all others may have their votes rejected by the GitD organizer and/or past and present GitD participants if those votes are deemed unfit.

Entries
Aesica – Marisu’s Adventures in Randomonia – older link, see below
Shake_N_BakerLunar Hex (My apologies for not including this in the original list)
ShalmezadPixel Wars (source)

 
Flag Post

Topic: Game Programming / GiTD #41 - *Random Generation*

Ladies and gentlemen, submission is now closed!
Voting thread will be up soon*. here

 
Flag Post

Topic: Game Programming / GiTD #41 - *Random Generation*

Final build is here

What’s funny is that the bullet/enemy collision, which removes a pixel was a bug from my original plan. However, I liked the way it looked, so I decided to keep it.

 
Flag Post

Topic: Game Programming / GiTD #41 - *Random Generation*

Originally posted by Aesica:

Here’s my thing so far. I’m happy with the controls for the most part, even if there are a few glitches still to iron out (the red flying thing sometimes sticks on the edge of the screen, but that’s an easy fix). I don’t know if I want the player shots to have a limited range, to be destroyed upon hitting walls, or both, so right now, they do neither and are overpowered because of it. Oh, and you can’t die yet.

Even if I don’t finish in time, I’ll have a basic platformer OR overhead-style engine to make future games with. (For the very first time, I made the physics engine in such a way that it is completely decoupled from everything else and thus, highly reusable. I’m quite pleased with myself about that)

Ok, if you can do that and build the platforming/overhead engine from scratch in ten days, I wonder what’s going to happen next time when you already have something to start with. O_o

 
Flag Post

Topic: Game Programming / GiTD #41 - *Random Generation*

New build: http://www.fastswf.com/r6v-9HE

I like the string → pixel generator I have now, so I think I’ll leave it in place. So feel free to go through and find a word that gives you the best look/stats.
edit: Didn’t realize it until afterwards that my keyboard helper class had a typo. So, I’d recommend using arrowkeys over wasd for that build. Unless you like going diagonally, in which case fire away.