Recent posts by qwerber on Kongregate

Flag Post

Topic: Game Programming / Haxe/OpenFL primer -- If Flash dies, this is your lifeboat

Is it just me or was HTML5 target out for a long time already?

 
Flag Post

Topic: Game Programming / [being updated] Haxe/OpenFL important inconsistencies

1. Initialize ALL YOUR GODDAMN VARIABLES. YES EVEN INTS AND BOOLS because on some platforms it will CRASH.

2. If you are compiling to neko (possibly native c++) and you have a class that extends Sprite, call super BEFORE you add children to itself, otherwise YOU WILL CRASH and THERE ARE NO DOCUMENTED ERRORS ON THE OPENFL FORUMS OR NEKO.

Also applies to above: Event listeners.

3. ALWAYS CALL Std.parseInt on JSON int data, not all platforms read int data the same way and I got some random turquoise color

4. When targeting C++ _callback AND __callback (2 underscores) are both reserved.

5. In HTML5 if you try to get mouse positions by Lib.current.mousex/y at the start of the application you may result with NaN, causing a chain of application breaking NaNs because Number + NaN = NaN

6. Once the mouse moves out of the window, Lib.current.mouseY returns last known mouse position as expected, but Lib.current.mouseX returns 0.
Goddamn inconsistent. This is why OpenFL isn’t widespread yet. This is on Neko and Windows.

 
Flag Post

Topic: Game Programming / Show us a screenshot of what you're working on!

Originally posted by Syurba:
Originally posted by DannyDaNinja:

I’ve heard of mystcraft, might get it some day.

Almost finished up on detention simulator, should be done within the week!

Looks good, stranger.

Reminds me of an old game where you have to fill up a cheat bar.

 
Flag Post

Topic: Game Programming / I have 2 recursive functions that use LinkedLists, need help converting them to iterative.

I know this isn’t an answer to your actual question, but do you really need the constructor in the recursive case?

Ah, thank you, I didn’t even notice that! They don’t have to be immutable my knowledge with recursion is very basic so I do not realize what values I can safely mutate.

As for your stated problem, let’s see what we can do…

I like the stack method, it almost simulates the actual stack, hehe. I think I will go with this one and after some research this seems like the typical way for conversion.

(I don’t feel like going for update_h at the moment, so that will have to do.)

No worries, I think I will try to figure out that one, thank you lots for help!

 
Flag Post

Topic: Game Programming / I have 2 recursive functions that use LinkedLists, need help converting them to iterative.

tried a lot, couldn’t do it without making things ugly. Singly linked lists.

	private function addsub_h(_sub:Sub, _lst:Cons<Sub>):Cons<Sub>
	{
		if (_lst == null)
			return new Cons<Sub>(_sub, null);
		else if (_sub.priority > _lst.first.priority) 
			return new Cons<Sub>(_sub, _lst);
		else 
			return new Cons<Sub>(_lst.first, addsub_h(_sub, _lst.rest));
	}
	public function update_h(_lst:Cons<Sub>):Cons<Sub>
	{
		if (_lst == null)
			return null;
		else if (_lst.first.remove == true)
		{
			subHash.set(_lst.first.id, null);
			_lst.first.wipe();
			return _lst.rest;
		}else
		{
			_lst.first.update();
			return new Cons<Sub>(_lst.first, update_h(_lst.rest));
		}
	}
 
Flag Post

Topic: Game Programming / Linked List (AS3) [Closed]

Use lists to learn recursion and stuff don’t use for speed. Just use * and you can put any data type in there, and do a lot of cool algorithms searches, sorting and stuff. Inffac the only methods you need for the Linked node are first and rest methods!

 
Flag Post

Topic: Game Programming / Modulus Operator Calculator

So meta.

 
Flag Post

Topic: Game Programming / This makes sense but sort of doesn't? What am I thinking that is wrong?

lim(x→ -Inf) ln x
= lim(x→ -Inf) ln (-x * -1)
= lim(x→ -Inf) ln (-x) – ln 1
= lim(x→ -Inf) ln (-x) – 0
= lim(x→ -Inf) ln (-x)
= Inf

but I know that in real numbers you can’t input a negative number into ln.

 
Flag Post

Topic: Game Programming / Deeper Topic (Part 0): Class Discussion and Review

Here is what setup looks like for me:

		KC8.subManager.addSub(new PositionSub());
		KC8.subManager.addSub(new CircleSub());
		KC8.subManager.addSub(new LerpSub());
		KC8.subManager.addSub(new MouseCoordSub());
		KC8.subManager.addSub(new CircleCollisionSub());
		KC8.subManager.addSub(new RandomCoordSub());
		
		var i:Int = 60;
		while (i-->0)
		{
			Factory.createCircle(400+i,300+i,10+i%30, 0xaaff);
		}
	public static function createCircle(_x:Float = 0, _y:Float = 0, _radius:Int = 10, _color:Int = 0x00):Ent
	{
		var e:Ent = new Ent();
		var p:PositionComp = cast KC8.subManager.get(POSITION).get();
		p.x = _x;
		p.y = _y;
		e.add(p);
enum StdComp 
{
	POSITION;
	CIRCLE;
	LERP;
	COORDINATES;
	MOUSECOORDS;
	RANDOMCOORDS;
	CIRCLECOLLISION;
}

I’m sure there are better ways but I find this to be fast. Problems are component dependencies because I chose not to use events but references:

	override public function cache():Void 
	{
		position = cast getComponentCache(POSITION);
	}

components is like a more sophisticated version of MVC.

 
Flag Post

Topic: Game Programming / GiTD #34 Has begun, the theme is "Creation/destruction"

Updated:

Fuck didn’t finish here is what i have.
https://dl.dropboxusercontent.com/u/17828135/bin/index.html
aroows move x jump
c to shoot particles.

I started yesterday…

 
Flag Post

Topic: Game Programming / I have some questions.

No age requirement but if no tax info you earn less. Music tracks should be from free resources to avoid legal action.

 
Flag Post

Topic: Game Programming / Awful Code [You've Written!]

Originally posted by GameBuilder15:
Originally posted by Feffers:


<br />
	for (var j = 0; j &lt; 30; j++){

Newbie question alert: What does the j &lt do?

&lt is less than sign, sometimes it doesn’t show up properly on this forum.a

 
Flag Post

Topic: Game Programming / Awful Code [You've Written!]

Originally posted by truefire:

A few days ago I wrote something along these lines (can’t find the actual code):

if (w &gt; Std.int(this.w * WIDTH)/width)

Variable naming…

You have a argument w, w, width, WIDTH, all accessible in one scope? This is probably the worst case in this thread :D

 
Flag Post

Topic: Game Programming / Some help with C++

Originally posted by pugzy:
Originally posted by StencylGames:

Um… you do know that Kongregate does NOT support C++, right? Plus, in programming, the syntax is EVERYTHING

Sorry everyone for going off-topic.

You do realize they have IFrames, through CGI or something you can make web apps with C/C++.

he’s just trolling across multiple accounts with no avail.

 
Flag Post

Topic: Game Programming / HTML/JS Game

I don’t quite understand when you asked us what you will get if you help us, since you’re asking for help free of charge, you shouldn’t charge is for helping us either.

 
Flag Post

Topic: Game Programming / Awful Code [You've Written!]

it keeps trying to find unmarked tiles and marks a random one and stops? and if it cant find one after 390 tries it gives up?

 
Flag Post

Topic: Game Programming / Compressing .swf

Originally posted by donut3456:

So i cam across the .swf for http://www.miniclip.com/games/heli-attack-3/en/ and it was LESS THAN 2MB….How is thatt possible? Did they use a special compression method? Im currently working on a flash game with much less graphics and only one song and it is 20 mb _

Probably unoptimized vector graphics and large audio file.

 
Flag Post

Topic: Game Programming / [AS3] Tile Based HitTestPoint Strange Effect

Think about how planets orbit. In the second example you are “staircasing” when travelling down because you don’t gain vertical velocity fast enough.

 
Flag Post

Topic: Game Programming / [AS3] Tile Based HitTestPoint Strange Effect

The second one is correct. Try making gravity force bigger in the second one (must be at least bigger than left /right moving speed).

 
Flag Post

Topic: General Gaming / league of legends no kill only push backdoor yi

bottom picture text: towers killed, inhibitors killed, minions killed, neutral monsters killed, and time spent dead.

 
Flag Post

Topic: General Gaming / league of legends no kill only push backdoor yi

I push 9 out of 11 towers. and win!

 
Flag Post

Topic: Game Programming / Angular movement physics (no libraries)

For each thruster do both torque and acceleration calculations.

 
Flag Post

Topic: Game Programming / GiTD #34 Has begun, the theme is "Creation/destruction"

Mouse
Tower defense
Puzzle
Underwater

 
Flag Post

Topic: Collaborations / Bringing 2d ORPG to a new cosole

You provided practically zero information.

 
Flag Post

Topic: Game Programming / Is it possible to publish AIR 3.5 to web?

You’d want a file reference object and use fr.open() or was it fr.browse();