Recent posts by ErlendHL on Kongregate

Subscribe to Recent posts by ErlendHL on Kongregate

avatar for ErlendHL ErlendHL 939 posts
Flag Post

Topic: Game Programming / Sub-pixel rendering - NOW how to prevent gaps between tiles in blitting

I cache the tiles in a good way.
First the LevelDisplayer (the big Bitmap), sends a list of the tile types that will be drawn, to Cache. Cache checks if tileSize has changed, if it has, it needs to cache all the tile types in the list, else, it will check with Skin if the graphics of any of the tile types in the list has changed. If it hasn’t, the tile type can be removed from the list.
Edit: And the tile types it doesn’t cache, that means it uses the last cache of that tile type.
So it’s really effective and it makes zooming run like a charm, because I only use copyPixels in the rendering.

 
avatar for ErlendHL ErlendHL 939 posts
Flag Post

Topic: Game Programming / AS3 - outline around text (solved lol)

Originally posted by UnknownGuardian:

You could use a glowfilter with strength 999999 and distance 2 or something like that. It gives a nice effect. (Hopefully that’s not what you meant by when you thought about something, otherwise I’ma delete my post)

Yeah good idea

 
avatar for ErlendHL ErlendHL 939 posts
Flag Post

Topic: Game Programming / AS3 - outline around text (solved lol)

Nice. Thank you for being rubber ducks :)

 
avatar for ErlendHL ErlendHL 939 posts
Flag Post

Topic: Game Programming / AS3 - outline around text (solved lol)

Hello there!
I have a white text that floats above some white lines, but sometimes it’s hard to read, so I need a black outline around the text. How do I do so? Does it work with a black bold text behind the white text? I could eventually use bitmap manipulation if you’ve got no other solutions.

Edit: 2 secs after I posted this, I suddenly thought about adding the textfields to another bitmap first, and using glow. I’ll see how it looks.

 
avatar for ErlendHL ErlendHL 939 posts
Flag Post

Topic: Game Programming / concat(null)

Why don’t you try it?

 
avatar for ErlendHL ErlendHL 939 posts
Flag Post

Topic: Game Programming / GITD Archive.

+1

 
avatar for ErlendHL ErlendHL 939 posts
Flag Post

Topic: Game Programming / Sub-pixel rendering - NOW how to prevent gaps between tiles in blitting

Originally posted by skyboy:

scale the final bitmap

I don’t like that solution because I would need a gigant Bitmap to zoom far out and it basically means that I must replace the Bitmap object every frame. or every time I change the scale

 
avatar for ErlendHL ErlendHL 939 posts
Flag Post

Topic: Game Programming / Sub-pixel rendering - NOW how to prevent gaps between tiles in blitting

Originally posted by skyboy:

Originally posted by ErlendHL:

Doesn’t seem to work.

Any ideas what I could do?

not scale.

everything you use should be designed around avoiding doing anything other than changing the x/y coords. everything the same size, or with a common factor, etc.

No, zooming is the thing that makes my game more awesome.
Hmm common factor you say? I do have a common factor, a tileSize variable, is it what you mean? Every tile have the same scale. Is there another way I could scale all the tiles, than scaling them individually?

 
avatar for ErlendHL ErlendHL 939 posts
Flag Post

Topic: Game Programming / Sub-pixel rendering - NOW how to prevent gaps between tiles in blitting

Doesn’t seem to work.

Any ideas what I could do?

 
avatar for ErlendHL ErlendHL 939 posts
Flag Post

Topic: Game Programming / Sub-pixel rendering - NOW how to prevent gaps between tiles in blitting

Got an idea; I can try to add position%1 / 20 to the scale.

 
avatar for ErlendHL ErlendHL 939 posts
Flag Post

Topic: Game Programming / Sub-pixel rendering - NOW how to prevent gaps between tiles in blitting

Originally posted by NineFiveThree:
Originally posted by ErlendHL:

Because of the scaling.

You do understand why blitting is as fast as it is, don’t you?
What happens when you apply any transformation to a pixel-based asset except translation?

The scaling is absolutely worth it to the game experience. It runs smooth so I don’t see the problem there.
The main reason I use blitting, is that I want control, and it makes it so much easier to render every tile every frame than to have tons of objects on stage.

 
avatar for ErlendHL ErlendHL 939 posts
Flag Post

Topic: Game Programming / Sub-pixel rendering - NOW how to prevent gaps between tiles in blitting

Originally posted by NineFiveThree:
Originally posted by ErlendHL:
How do I prevent gaps without rounding?

By rounding them all the same way (or not at all).
Why do you need to round the values? why do you have gaps?

Because of the scaling. Each tile is 20 px wide and tall. The scale is always x/20 where x is an integer. That means if a tile is at a rounded coordinate in the bitmap, it will be scaled so that the size perfectly fits the pixels as well.

 
avatar for ErlendHL ErlendHL 939 posts
Flag Post

Topic: Game Programming / Sub-pixel rendering - NOW how to prevent gaps between tiles in blitting

Originally posted by NineFiveThree:

Are the position values you blitt to float values or integer values?
post some code.

Oh here’s the thing… I int() the coordinates when I render the tiles to prevent gaps between them when scaling. How do I prevent gaps without rounding?

 
avatar for ErlendHL ErlendHL 939 posts
Flag Post

Topic: Game Programming / Sub-pixel rendering - NOW how to prevent gaps between tiles in blitting

Flash’s display system uses sub-pixel rendering. In my tilebased game I’m using blitting instead of Sprites and MCs etc all the way, but then it snaps to pixels, also when I set snapPixels to “never” and smothing to true.

 
avatar for ErlendHL ErlendHL 939 posts
Flag Post

Topic: Game Programming / Sub-pixel rendering - NOW how to prevent gaps between tiles in blitting

How to apply sub-pixel rendering in a Bitmap?

Now: How to prevent tile gaps. Scroll down.

 
avatar for ErlendHL ErlendHL 939 posts
Flag Post

Topic: Game Programming / Worried

I really dislike JavaScript for the fact I can’t write clean and readable code in it.

 
avatar for ErlendHL ErlendHL 939 posts
Flag Post

Topic: Game Programming / Worried

Originally posted by Orangatang91:
Originally posted by ErlendHL:
Originally posted by Orangatang91:

I’ve heard the world is gonna end in 2012. So ya do it really fast.

Lol that’s bullshit there’s only gonna be a change.

Mmmm what change? And HTML5 taking over flash is also bullshit don’t worry about it.

Who knows… the world will not end, but something might happen. You know.. world sucks today so it should change.
Thanks.

Originally posted by DrYoshiyahu:

Don’t worry that’s never going to happen. Actionscript 3 was supposed to end AS2 forever. And AS2 was supposed to end AS1 forever, but they are both being widely used. HTML5 and Actionscript are quite different and personally, I can’t ever imagine Flash games being replaced by anything else.

Ok thank you :)

 
avatar for ErlendHL ErlendHL 939 posts
Flag Post

Topic: Game Programming / Worried

Originally posted by Orangatang91:

I’ve heard the world is gonna end in 2012. So ya do it really fast.

Lol that’s bullshit there’s only gonna be a change.

 
avatar for ErlendHL ErlendHL 939 posts
Flag Post

Topic: Game Programming / Worried

Hey.
I’ve heard that HTML 5 might take over for flash… I’ve been working on my game for more than a year (learned while programming) maybe two… What if kongregate does not support Flash when I’m done? Or will it support both flash and HTML?
Anyway, should I rush the game to finish now asap; do I benefit from having it done fast?

 
avatar for ErlendHL ErlendHL 939 posts
Flag Post

Topic: Game Programming / I'm new at creating flash Games.

Originally posted by DannyDaNinja:

I bookmarked that image for future referencez

lol

 
avatar for ErlendHL ErlendHL 939 posts
Flag Post

Topic: Game Programming / Yet another is this legal thread

Pirate, damn you. Why are you trying to do that?!

Also, this does not have anything with programming to do, and if you said that only to Draco, why not PM him instead of posting a new topic?

 
avatar for ErlendHL ErlendHL 939 posts
Flag Post

Topic: Game Programming / How to stop hacking

The only way is to make everything serverside. Only user interactivity, user interface and graphics displaying in the client. You send the user inputs to the server and have all the logic on the server. It sends only data about what to display back.

 
avatar for ErlendHL ErlendHL 939 posts
Flag Post

Topic: Game Programming / Difference in .swf file size

Originally posted by skyboy:

compression

Oh hmm I forgot that I use an older version of FD on this computer…

 
avatar for ErlendHL ErlendHL 939 posts
Flag Post

Topic: Game Programming / Difference in .swf file size

On my school pc, the compiled swf file of the exact game is around 400 KB.
At home, it’s 800. Why?

 
avatar for ErlendHL ErlendHL 939 posts
Flag Post

Topic: Game Programming / Funny Videos

So where does the programming come in?