2

I'm still pretty new to game programming and any tutorial that I have worked with stuck to only games with the initial screen. I want to start creating my own games but there are a few things that I still need to learn. One of them is how to create a game that side-scrolls. For example; Mario... Or ANY type of game like that...

Can anyone give me a small example to create something like that. I'm not asking for any specific language because currently in school I am learning javascript but I know some c++/java/processing/objective-c as well. So any of those languages would be fine and I could probably implement it in any of the others...

I have been searching for some help with this for a while now but could never actually get any help on it.

Thanks in advance!

D34thSt4lker
  • 447
  • 1
  • 5
  • 12
  • just a suggestion, not an answer, you should check out [pygame](http://pygame.org/news.html) it is a python library that allows you to manipulate graphics and I found it very easy to start learning graphics. If you manage to draw circles, squares, and other geometric shapes, then move to how to make object move responding to user input, such as keyboard keys or mouse, if you need more help using pygame, plz let me know – user1406062 Sep 16 '12 at 04:10
  • I'll take a look at it. But Python is one of the languages I have never used before. But I'll comment back here after going through it. Thanks! ---- I recently finished making this http://temp-share.com/show/2gFHcuqf8 through processing if you are curious to know where I currently am in programming... thanks – D34thSt4lker Sep 16 '12 at 04:16
  • I don't know if you're aware, but one of the simpler methods is to have a very wide picture that you can move left when the character would move right and vice-versa, but have the character stay in the middle of the screen. – chris Sep 16 '12 at 04:20
  • Yes, I was told about doing something like that but when I tried getting a large image in Processing, the program wouldn't run and say the image can't be larger than the size of the program... So I couldn't try it on that. Besides, I wasn't exactly sure how to implement that way without any visual help – D34thSt4lker Sep 16 '12 at 04:25
  • @HussainAl-Mutawa ... just finished looking through some "lectures" of the pygame stuff... not sure if i want to get into that right now... but thank you! – D34thSt4lker Sep 16 '12 at 05:30
  • @chris, my bad on that comment towards you... I was setting the background as the image when I should have just drawn the image onto the screen and use what you said... Gonna try now. thanks! – D34thSt4lker Sep 16 '12 at 05:44
  • Are you fluent on java and c++?, you should pick the one you're most familiar with, choosing the language is the first step. C++ has a lot of libraries for 2d games, which you can make a scroll game, Allegro, SFML..etc. with very little research you can find a lot of them and they don't require much language skill for development. – Vinícius Sep 16 '12 at 06:15
  • Well I'm not professional but I know some stuff... This is the first semester I've touched C++ in about a year or so and I'm getting frustrated even learning it (data structures) because the professor takes a whole class to go through a 10 minute discussion... But if you were able to point me to tutorials for either Java OR C++ that would be really helpful – D34thSt4lker Sep 16 '12 at 06:19
  • Maybe, if you post game related question on [GDSE](http://gamedev.stackexchange.com/) you will get more relevant answers. – ErikEsTT Sep 16 '12 at 07:12
  • If you just want to start doing something, then use whatever tool you know, but if you'd like to go seriously into game programming, start by choosing an engine from this list: http://en.wikipedia.org/wiki/List_of_game_engines – enobayram Sep 17 '12 at 04:44

1 Answers1

0

Regardless of the programming language you choose, and whether you choose to use any higher level graphics, or even a game programming library, a fundamental technique you need to learn is creating the illusion of side movement. As pointed out, this can be achieved by drawing your avatar at screen center and then moving the image behind it. That can be accomplished in different ways, such as rendering and clipping different parts of a larger image, or if you are using a graphics/game library involving camera objects, dynamically controlling the portion being rendered by the camera.

Is your goal here to learn game programming, or are you just learning programming and briefly looking at game programming? If the former, than you really should invest the time to learn one or more game programming technologies. I would recommend you take a look at Unity, which is free to download and try out. The scripting language Unity uses is essentially javascript (you can also use C#), so you'll already be comfortable. Go through some of the tutorials and you'll be off and running in no time.

Note using technologies like Unity (and others) let you create game objects that move through two and three dimensional space, and which are rendered based on one or more cameras. Your backgrounds (or terrains in a 3d world) remain fixed, which more closely reflects the reality we live in. So mentally it is actually easier to develop using these technologies, then faking it through illusory techniques.

CBass
  • 983
  • 6
  • 11
  • Thank you. and yes i would like to start actual game programming. i do have unity but have not used it yet... hopefully will get started on it soon. thanks for your input – D34thSt4lker Sep 19 '12 at 02:05