Implementing a 2D Scroller Game

I’ve found one topic on this so far and it has a pretty good idea, but it was not elaborated on. https://blenderartists.org/forum/viewtopic.php?t=15624&highlight=walking

It was talking about creating a 2-D scroller by using animated textures. I’m wondering how that can be done. First off one would need all the textures of the character actions (walking, running, ducking, etc). Then you would create a plane or a rough outline of the character then uv map the different textures onto the plane. When the person presses left or right, then somehow you can make the textures change, making it look like the character is walking. This makes sense to anyone so far?

I’ve got some textures for a character I created in Flash and I was going to create the game in java, but too bad my programming skills in java wasn’t good enough. So I wanted to change and make it in the Blender game engine.

There’s the animated textures problem, but there’s a tutorial on that so I think I can accomplish that.

Ok, the question is how do you make the texture animate only when the user presses left or right? There’s also the problem of how a character will only face left when left is pressed and when only right is pressed. How can I implement that with only textures of the character facing left?

Thanks.

Jason Lin

To make a 2d game, use a 2d engine. AGS in my sig is a point and click adventure game engine with scripting capabilities that would allow a keyboard controlled sidescrolling game.

This could be accomplished with python, but would be a bit difficult to work with. A better choice would be to remake the character and do all the animations with an armature. This way, the animations are smooth, and you don’t have to draw all the individual frames or work with the headache of setting the right textures at the right time.

In case you want to look at a script that can be modified to help, check out Doc Holidays UVAnim 5in1 script:
http://project-blender.onlinehome.de/TileTex5in1.zip

But it’s really a lot easier working with 3d objects for animation.

Hmm… for a 2D game you can…

Have a parent object with no vertexes or anything, this will handle the collisions and events, then have a children plane with Walk-Left texture, when the character runs, this plane is replaced (simple logic bricks) with Run-Left… that could be a safe method…

Obviosly a 2D engine would be much better…

But 2D & 3D make good combinations at times :smiley:

I don’t want to try to use a 2d engine. Lol, that would mean learning a whole different program. I guess it would be a good experience, but I want to just spend my free time blending. Only really free to do something during the holidays and weekends.

Hmm, so use a 3d character for a 2d scroller. It would make for a pretty cool look. I wanted to use a 2d character and then transform him into a 3d character so I could make a 2d game and then a 3d game. Hmm, maybe I’ll just use the same character I made for the 2d scroller first then. Hmm, wouldn’t that make a higher poly count then? I could always use the culling script though.

shbaz I might try out that 2d engine sometime, but since it’s orignally used as point and click, I’m going to have to brush up on my C coding.

saluk thanks for the link to the script.

Thanks Fred_Pyo for the idea. I might try it since I already have the walking textures I did previously before.

Thanks for all the ideas and suggestions.

Jason Lin

Anyone remember GTA, the first one, 3D combinated with planes with animated textures on it, like cars and people, while the houses where 3D. That game is a good example using opengl 3d games with plane objects. :slight_smile:

I’m going to try out the 2d scroller in blender sometime. Hmm, most likely with the plane and animating textures method. I’ve found out that there are so many sprite sheets online and I could just easily use some of them as long as I give credit to the artist. Hey, maybe someone will try before me or have already. We’ll see.

Jason Lin

All you need for a 2d scroller is just a character (can be a 3d model) and only let him move in 2 dimensions: Up and down, left and right. You can have some cool 3d background, but have the left key go left and the right key go right, then have a jump key or something, just as you would in a 3d game, only no turning. Having a 2 1/2D game (like Kirby on the 64, the character only moves left or right but the “path” that the character follows twists and turns) would be a bit more difficult. You’d have to figure that out…

Pooba