Jump to content
  • Advertisement
Sign in to follow this  
iwant230k

How to make a game like this?

This topic is 4019 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Here are the features of the game: -2D -When game is started, the background is animated and the player can control movement of an object but not the background. -The object can bounce, jump, self-rotate or rotate spirally in all directions when player command the object to do so in the game. -When game is ended, score is counted and saved into a .txt file so that there is a record for that player. Each player's record is saved in 1 file. -When the object moves, it has sound effect. My problems are the animated background ,the user-controlled movement of the object ,creation of txt file and access to txt file by the program and sound effect. How to make these in game? What language and tool do you suggest me to use? Plz suggest the simplest one. Is there any online resource for reference? Is it possible to make such a game with visual C++? Thanks in advance!

Share this post


Link to post
Share on other sites
Advertisement
I'm guessing you're starting with no software knowledge? You can do this in Java, C#, C++, and likely others I don't know off hand.

"My problems are the animated background ,the user-controlled movement of the object ,creation of txt file and access to txt file by the program and sound effect. How to make these in game?"

So...you mean everything?

I can tell you how to make and read text files in C++, but I'd highly suggest you take some time and begin learning some software languages before you move on to game stuff.

M.

Share this post


Link to post
Share on other sites
Quote:
Original post by M Eversberg II
I'm guessing you're starting with no software knowledge? You can do this in Java, C#, C++, and likely others I don't know off hand.

"My problems are the animated background ,the user-controlled movement of the object ,creation of txt file and access to txt file by the program and sound effect. How to make these in game?"

So...you mean everything?

I can tell you how to make and read text files in C++, but I'd highly suggest you take some time and begin learning some software languages before you move on to game stuff.

M.


Thank you. I only know visual C++ and C++ and I am not good at both. Someone told me these 2 languages are not good to write such a game and suggest visual basic and flash. Do you think visual basic and flash are more suitable in my case? Which one is better? Which one is easier? Any other suggestion?

Share this post


Link to post
Share on other sites
I would recommend you look into SDL. http://www.libsdl.org/

This is a c++ library that uses OpenGL as the renderer. You can quickly use it to put together a 2D game with sound!

Share this post


Link to post
Share on other sites
I'd recommend writing it in C++, for didactic purposes ;)

Look into SDL as mentioned :) I don't know how far your programming knowledge/spirit goes, but here are some ideas flying through my head as a beginning games programmer myself:
---
Have an array of SDL_Surfaces for the animated background, and display them after eachother using a counter in your main game loop (like in a gif) (very simple solution)

You used the right word: Make a class and create an object that has several functions like jump() and collide(), and rotate(), and call those functions using some if(position)'s or if(event)'s

After you quit your main game loop use <fstream> to save to a txt file (just as simple as cout and cin in console applications). The player's name and his score (a std::string and a int/double) can easely be worked in there.

SDL has great sound support when you use the SDL_mixer extension. You could just fit in the sound effects inside those if()'s I was talking about before ;)
---
I hope I was any help, I'm not an experienced programmer myself at all. I have only managed to program TicTacToe, and I'm a little stuck on programming Bejeweled.. I might try programming a game similar to the one you sketched here though (if you don't mind), it sounds like a lot of fun and very educative :)

Share this post


Link to post
Share on other sites
So you're pretty new to programming, and you want to create a game rather sooner than later?

I'd suggest using Python - a high-level scripting language, relatively easy to learn and pretty fast to work with - in combination with a library such as PyGame. I'm just getting started with PyGame, but I've used Python before for a 3D game and I'm pretty happy with how fast I could get a game up and running, so I've got good hopes. :)


@c4c0d3m0n: Why C++? It takes a long time to learn properly, and isn't really the fastest language to work with. I've been using it for 5 years now and I'm still happy with it, but during the first 3 or 4 years, I didn't even know what stack and heap memory was and how it affected my code, or how usefull STL containers are versus arrays. With Python, you don't need to bother with many of these details and nasty surprizes, and besides, you'll get results faster. :)

Share this post


Link to post
Share on other sites
Quote:
Original post by Captain P
(...)

@c4c0d3m0n: Why C++? It takes a long time to learn properly, and isn't really the fastest language to work with. I've been using it for 5 years now and I'm still happy with it, but during the first 3 or 4 years, I didn't even know what stack and heap memory was and how it affected my code, or how usefull STL containers are versus arrays. With Python, you don't need to bother with many of these details and nasty surprizes, and besides, you'll get results faster. :)

I have been working with C++ less than a year now, and I don't know what those things are. I don't think I'd need them to program a game similarly to the one described in the OP. Maybe pointers would be a good thing to learn before starting on the animated background, but for the rest I believe I know enough programming to realize such a game :)
I started with C++, got thrown right in with the rest of my class, although I seem to be the only one that got sucked in ;) I bet that results will appear much faster using Python, but I am not sure wether that's the most didactic way to go ;)

Share this post


Link to post
Share on other sites
Sure, you probably know enough to get such a game done, but that wasn't my point. You're not familiar with the things I mentioned - stack and heap memory, STL containers - so it's very likely that you'll run into memory leaks eventually. You're also using arrays, which limits you to using a predefined amount of objects. The STL container classes don't have that limit: you can add and remove objects whenever you want, and it'll take care of the memory allocation and deallocation for you.

So, why would C++ be more educative, when most people don't even see it's pitfalls and overlook it's standard library most of the time? I certainly learned quite a few bad habits in the early days... With Python, I didn't really see potential pitfalls so far: memory gets managed for you, so objects that aren't referenced anymore are cleared up for you. Lists and tuples are resizeable by default, so no array size hardcoding and tricky stuff like that. Just to name a few things.


I don't mean to attack you, nor do I want to advertise Python as 'the only true way' (because it isn't - no single language is best for all situations), but I do question your statement that using C++ is more didactic. Sure, there's more things that you should learn before you can use C++ properly, but from personal experience I can't say I actually learned them - not untill much later. It's just not a beginner-friendly language. Python, on the other hand, is actually easy to learn. So why would it be less didactic? :)

Share this post


Link to post
Share on other sites
I see your point now :) I started with C++, and I survived untill now, so therefor I thought I would share my experience. Python sounds interesting too, I might even have a look at it over the holidays. Also, these STL containers that you speak of sound as if they were exactly what I need for certain game-designs that are swimming through my head... I'll have to do some research :) Thank you

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!