How can I program this?

Started by
4 comments, last by jlubeck 11 years, 9 months ago
Hi everybody, this is my first post here, I didn't know where to get help and this looks like the right place.
I have experience programming some basic things in ActionScript3. But I never really made a proper game. Just very basic ones like a pong, a puzzle, and I've been lately following the series Staring with Starling from [color=#666666]Hemanth Sharma at http://www.hsharma.com/tutorials/.
He's teaching to make some sort of platformer, (you can see where I'm at with it at http://testing.fyrastudio.com/lab/starling/2012-07-01/) and I'm getting some nice game programming concepts from there, but until he releases the next one, I want to start making my own.
I already have the assets and it involves several concepts in the same game... but let's begin with one...
The idea is for an athlete to be running forward. The "camera" is like a first person. I say "camera" because it's 2D. I'm attaching a still so you can all get a better idea.

Now, the problem is that I don't know how to start... or how the logic would work... I'm not asking for anyone to code anything for me, just to help me turn my head around this to understand the logic that I would have to make in order for the character to be advancing forward, the obstacles coming up once in a while, and coming to a finish line...

I hope I could make myself clear, and that this is placed in the right forum with the right title. If any moderator seems it should be placed or named otherwise, just do it...

Thanks a lot and I hope anyone can help me, and that this post may be of help to anyone in the future...

Cheers!!
Advertisement
For a beginner's topic, you've picked a fairly complex situation. Moving into the screen for a 2D game isn't the easiest thing to program, even for an advanced programmer.

As with any game, you will be recording the world location of your runner within your track. So, if you use up to start the runner forward, he would move whtin your world. however, you need to represent the world, as the runner moves into the screen. How to do that?

Good question. A simple method would be to have a static background (like the track in the picture, without the hurdle), but have hurdles scale up into the scene as you get closer to them.

If you want the background to change (ie, the runner gets closer to the stadium), you'll need multiple background images, or smartly scale the image you have to make it appear the runner is getting closer to the stadium.

That's just my initial thoughts on doing something like that. Good Luck!

My Gamedev Journal: 2D Game Making, the Easy Way

---(Old Blog, still has good info): 2dGameMaking
-----
"No one ever posts on that message board; it's too crowded." - Yoga Berra (sorta)


Moving into the screen for a 2D game isn't the easiest thing to program, even for an advanced programmer.


QFT, my memories of the "good ol' days" of trying to get pseudo-3d to look right seem to be of frustration. Be prepared for a lot of iteration of slight changes to the artwork and scaling/moving code. In this case, you will also need to time the animation of the running and jumping and timing of pseudo-collision detection.

My advice (just my opinion, feel free to ignore of course): for your first attempt, make it a side-scrolling game instead. It can still look good (given good art), and have a cool retro feel if you add multiple layers of parallax scrolling or something.
Hey guys, thanks for your recommendatios! Maybe I placed the thread in the wrong forum?
I already know how to make side-scrollers, I have some experience coding basic games, you can have a look at them here:
https://apps.facebook.com/nanotak/
http://www.fyrastudi...y_ColoringBook/
http://www.fyrastudi...rutifantastica/
http://www.fyrastudi..._SlidingPuzzle/
http://www.fyrastudi.../adMotion/ycar/

But I still consider myself a beginner because I can't seem to get my head around more complex things like this...

Although this quote kinda gave me some ideas:

As with any game, you will be recording the world location of your runner within your track. So, if you use up to start the runner forward, he would move whtin your world. however, you need to represent the world, as the runner moves into the screen.

The idea would be think more abstractly right? The track is a constant Number of X units. Lets suppose I want the user to run with the forward button, everytime he presses that, the runner would increment its number. Once he reaches the X he reached the finish line... For the obstacles, its just a matter of placing them in various points throughout the X. I just program it like that, and then I think of a way of showing that with my assets...
Is that the right way to go???

Thanks!!

Hey guys, thanks for your recommendatios! Maybe I placed the thread in the wrong forum?
I already know how to make side-scrollers, I have some experience coding basic games, you can have a look at them here:
https://apps.facebook.com/nanotak/
http://www.fyrastudi...y_ColoringBook/
http://www.fyrastudi...rutifantastica/
http://www.fyrastudi..._SlidingPuzzle/
http://www.fyrastudi.../adMotion/ycar/

But I still consider myself a beginner because I can't seem to get my head around more complex things like this...

Although this quote kinda gave me some ideas:
[quote name='BeerNutts' timestamp='1341377478' post='4955518']
As with any game, you will be recording the world location of your runner within your track. So, if you use up to start the runner forward, he would move whtin your world. however, you need to represent the world, as the runner moves into the screen.

The idea would be think more abstractly right? The track is a constant Number of X units. Lets suppose I want the user to run with the forward button, everytime he presses that, the runner would increment its number. Once he reaches the X he reached the finish line... For the obstacles, its just a matter of placing them in various points throughout the X. I just program it like that, and then I think of a way of showing that with my assets...
Is that the right way to go???

Thanks!!
[/quote]

From your quote:

But I never really made a proper game. Just very basic ones like a pong, a puzzle
[/quote]

[background=rgb(250, 251, 252)]it sounded like you've only done very simple games.[/background]




[font=helvetica, arial, verdana, tahoma, sans-serif][size=2][color=#282828]In general, yes, as the player holds up, he is constantly increasing his location in the world in units. but, you need to make it look like he is, so the objects will have to scale towards him (and past him for some background objects). [/font]

My Gamedev Journal: 2D Game Making, the Easy Way

---(Old Blog, still has good info): 2dGameMaking
-----
"No one ever posts on that message board; it's too crowded." - Yoga Berra (sorta)

Ok, since I'm encountering some problems, and some of you seem to think this is not very Beginner, I started another thread with the specific problem:

http://www.gamedev.net/topic/627525-problem-with-running-and-jumping-at-the-same-time/

Thanks!!

This topic is closed to new replies.

Advertisement