Recent posts by BrainStormer on Kongregate

Flag Post

Topic: Game Programming / UDP in Flash Player

RTMFP is a protocol atop a protocol if I understand it right, not exactly a clean UDP it may suit me. And I have yet to find out whether it may or may not be used freely and without a Flash Media Server. I will surely look at it, thank you.

 
Flag Post

Topic: Game Programming / UDP in Flash Player

Hi.

Is it possible to use UDP communication in Flash Player (not in AIR) somehow?

I have done a small research of the UDP socket implementation possibility in Flash Player and so far didn’t find any working solution out of the box.

There is an old discussion here: http://www.kongregate.com/forums/4/topics/49058
where the author claims that he has accomplished it, though no proof nor example.

Also I found the notice:

The future versions of Adobe Air 2.0 and Flash 10.1 will finally also support UDP

It is here: http://www.tuio.org/?flash
The Flash part didn’t happen, did it?

The only way I can think of is to use some wrapper say node.js to handle socket communication.

Has someone achieved UDP communication in the Flash Player somehow?

Thank you.

 
Flag Post

Topic: Game Programming / Native mouse cursor replacement

Thank you guys. Unfortunately no solution is found so far.

Quickly did a google search and found this. You can even do animated cursors.

Yes, that’s what I am talking about. I have already done custom cursor but the question is how to make it work automatically.

you can only add your own cursors, but cannot change the behaviour of automatically changing the cursor to say a hand over a button. One would have to create that functionality by hand.

Exactly. And creating this functionality by hand means having to deal with many nuances like mouse-out-events-not-being-dispatched-when-object-under-cursor-is-removeChilded etc etc.

if (nativeCursor.type == “HAND”) {

When do I perform this check? How can I catch the moment the mouse cursor changes (automatically changes, please note)? On enterframe?

 
Flag Post

Topic: Game Programming / Native mouse cursor replacement

Hi.

How do I replace say hand cursor with a custom one? I am talking about native cursors (Mouse.registerCursor, etc…).

I can register any cursor I want and make it active, but how do I replace the default hand cursor projectwide like Mouse.replaceCursor(MouseCursor.HAND, customHandCursor) or something? Nohow?

Thank you.

 
Flag Post

Topic: Kongregate Multiplayer Games / [Lost Magic] access denied

Hi. That was a temporary issue. Everything is allright now. Sorry for the inconvenience caused.

 
Flag Post

Topic: Kongregate Multiplayer Games / [Lost Magic] Server merge issues.

Hi.

We are currently working hard and tirelessly to make it allright. Here’s what’s going on recently…

Newly added items to the Auction House should work and display correctly.
Location images have been translated.
Jewellery recipes have been recovered.
Library and Events’ images have been fixed.
Characters’ ‘Extra’ parameters’ names have been translated.

Chat Achievement notifications in wrong language are currently being fixed.
Wrong language in mail letters is also being fixed.

Please reequip belt items for them to work correctly.

We are sorry for any current inconsistencies, but don’t you worry, everything will be fine.

Thank you.

 
Flag Post

Topic: Game Programming / displayList enigma

Put every tile into some array and then sort it by the ‘y’ property.

tilesArray.sortOn("y", Array.NUMERIC);
for each(var tile:Tile in tilesArray) {
  addChild(tile);
}

Something like this. Not the ‘techy’ way, but convenient. Does this help?

 
Flag Post

Topic: Game Programming / Adobe Air Application Quitting Automatically

Does targeting release mode solve this issue?

I didn’t quite catch of what you said. What is a targeting release mode?

 
Flag Post

Topic: Game Programming / Adobe Air Application Quitting Automatically

I have experienced such problems several times before. The solution for me turned out to be a very strange one: comment out all the trace calls. Or delete them. I didn’t research this issue further though and don’t know whether this is your case too.

 
Flag Post

Topic: Game Programming / Is it possible to "inherit" an interface from a type?

Originally posted by skyboy:

Originally posted by BrainStormer:

I have a strong opinion, and you’ll never convince me otherwise

well, that’s a stupid stance to have on anything.

And that is your strong opinion on which I am not going to convince you otherwise. Anyway, I’m sorry, didn’t intend to say anything rude.

 
Flag Post

Topic: Game Programming / Fullscreen resolution

In most modern-day videogames (non-flash) you can change the fullscreen resolution.

As far as I know there is yet no way to change the Flash Player’s output fullscreen nor windowed resolution. You can use blitting to make the output look like it should be at a lower resolution, but technically it will still “feed” your monitor with all the pixels for it’s current resolution. Say pixel doubling will make four adjacent pixels show the same color, so visually it will look like half the resolution, but it’s still four smaller pixels, not one big one. And I don’t know whether or not will you get any performance boost that way.

 
Flag Post

Topic: Game Programming / Is it possible to "inherit" an interface from a type?

I have a strong opinion, and you’ll never convince me otherwise, that only the programmer that does the task decides which tools to use and which way to use them for that task. If you know how to use a factory and you feel comfortable and convenient with it then use it as long as it makes the job done the better way. Yes, if it is a spice rack then maybe you need just a hammer, but if your task is to build a Boeing and you are going to do it all with hammers, well then, you’re screwed.

 
Flag Post

Topic: Game Programming / Is it possible to "inherit" an interface from a type?

I don’t know any more decent IDE than the latest FDT. Flash builder doesn’t do a bunch of critical things, so does not FlashDevelop.

 
Flag Post

Topic: Game Programming / Is it possible to "inherit" an interface from a type?

i’m pretty sure it came about when people began using complex objects in pools; good intentions gone corporate

The reason here is much simpler. It’s not even a Factory Pattern actually, just a convenient name for the class which requests and receives broadly typed objects and then returns them. The whole thing is to eliminate any class dependencies between the object recepient (where I put that image) and the object’s class (the GenericImage itself) so I don’t have to wait about a minute for the IDE to rebuild the project each time after I make a tiny edit and press CTRL+S (which is meant to be done often). If nothing depends directly on the edited class then only that class gets rebuilt. Also cuts time during incremental compilation. It has nothing to do with patterns or coding habits, just a workaround for a silly problem.

Thanks, everyone!

PS: Sorry for my English.

 
Flag Post

Topic: Game Programming / Is it possible to "inherit" an interface from a type?

It is extended. But in the construction

var image:IGenericImage = Factory.produceGenericImage();

the ‘image’ variable is of IGenericImage (interface) type, not just GenericImage. So I cannot addChild the ‘image’ because the interface IGenericImage is not a Sprite nor can it extend Sprite unfortunately.

 
Flag Post

Topic: Game Programming / Is it possible to "inherit" an interface from a type?

Hi.

var image:IGenericImage = Factory.produceGenericImage();
image.load(IMAGES_PATH + model.image + ".jpg");
addChild(image as Sprite);

IGenericImage is an interface.
Here I cannot just addChild(image) because it’s type is not known (except it’s an Object), but in fact it is a Sprite. So I have to cast it as a Sprite everywhere. Also I’ll have to define a heap of other methods (like get x, set x, get y, set y, eight methods for all the rotations etc) in the interface.

Isn’t there a way to like inherit an interface from say the Sprite type?

Thank you.

 
Flag Post

Topic: Game Programming / How to make a game scrollpane to scroll but the browser window to not?

Sounds good, but I didn’t quite catch this:

will allow you to catch and dispose of the events before they’re passed on to the browser

How… erm… How do I dispose of them and not let them be passed on to the browser? Simple event.stopPropagation() won’t work, will it?

 
Flag Post

Topic: Game Programming / [solved] AS3 vs Java: How to make function references?

Ah, nice!
Your example solves two problems at once. Thanks a lot.

 
Flag Post

Topic: Game Programming / [solved] AS3 vs Java: How to make function references?

Hi.

I have a list of possible incoming commands. When a command arrives I am NOT doing a switchcase to determine what function to execute. Instead I call a reference by name. Here:

package {
	public class SomeClass {
		private var hashMap:Object;

		public function SomeClass() {
			hashMap = new Object();
			hashMap[Command.INITIALIZE] = initialize;
			hashMap[Command.CHECK_NICKNAME] = checkNickName;
			hashMap[Command.UPDATE_MODEL] = updateModel;
		}

		public function processCommand(command:String):void {
			if(hashMap[command] is Function) {
				var functionHandle:Function = (hashMap[command] as Function);
				functionHandle();
			}
		}

		private function initialize():void {
			// some code here
		}

		private function checkNickName():void {
			// some code here
		}

		private function updateModel():void {
			// some code here
		}
	}
}
<pre>

Now, I have spent days looking for a way to do this in Java. And didn't find anything. Is there a way?

Thank you.
 
Flag Post

Topic: Game Programming / How to make a game scrollpane to scroll but the browser window to not?

Hi.

Say a published game here on Kong has a scrollpane somewhere inside it. When I mouseover it and roll the mouse wheel the scrollpane scrolls but the whole browser window scrolls too. How to avoid window scrolling?

Thanks.

 
Flag Post

Topic: Game Programming / How to make space between text paragraphs?

So no easy way…

OK, I believe I can handle it by using TLFTextField but I cannot get it to work. TLFTextField doesn’t seem to exist inside the FlexSDK as my IDE (FDT that is) cannot resolve it and cannot import it. UNLESS I add TLFTextField into my Assets.fla library and compile it to .swc file. Now I can import it and use in my code.

All well but Flash IDE yields a warning while compiling .swc file:
Warning: No libraries were linked as Runtime Shared Libraries (RSLs) because of your publish settings: Export SWC

and .swc file grows by almost 500KB. How should I use TLFTextField the correct way?

EDIT: And the final .swf file grows by 200KB

 
Flag Post

Topic: Game Programming / How to make space between text paragraphs?

The text is going to be marked and copy-pasted by users to somewhere. This way the paste will include extra line breaks, which is not good.

 
Flag Post

Topic: Game Programming / How to make space between text paragraphs?

Hi.

A single TextField should be formatted to display some text paragraphs. There should be extra spaces between each paragraph but not between the text lines inside the paragraphs.

It should look like this:

I have tried:
- Leading. Yields spaces between ALL text lines, not only between paragraphs.
- HTML ‘p’ tag. No change.
- HTML ‘font’ tag with large ‘size’ style and a space character. Some weird results.
- HTML ‘span’ tag with a single large-fonted space. Same as above.
- ‘margin-top’ style. No result as it is not supported.

How should I do it?

Thank you.

 
Flag Post

Topic: Game Programming / [solved] How to get an array of public variables?

Thanks, guys.

 
Flag Post

Topic: Game Programming / [solved] How to get an array of public variables?

vesperbot, thanks, but it would yield only dynamic members but not the ones declared like public var something:int.

UnknownGuardian, thanks, but no, I was just using a wrong account to post :)