Jump to content
  • Advertisement
anupgupta

Make Game like Machinarium

This topic is 2341 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

Hello

Just recently i have been given a game to be made..which is really interesting and exciting and the game is a bit similar to the puzzle and adventure game like Machinarium.

where there is your main game character and he would interact with the various interactable elements of the game and solve the puzzle.

similarly there would be different game levels...(if one level is solved then the other unlocks..and so forth)

what i would like to know, is to what game structure, or some important key points and tips i should take into consideration before getting into actual development.

engine to be used is Cocos2dx.
Platform to be made for is Apple iPad.

Please suggest some information for making such kind of game.

Regards

Share this post


Link to post
Share on other sites
Advertisement
For something like Machinarium I wouldn't bother with much structure - most of it can be hardcoded / hacked together. Pretty much all you need to do is define zones for each level, with what happens when you click on a zone or drag an object onto that zone (if I'm remembering correctly, those are the only interactions possible).

Share this post


Link to post
Share on other sites
hello turch

thank you for the response.

but i would like to know more about zones..as you have said above. (Please elaborate on this)

my character has to move and go to the spot anywhere i click on the screen..also i have a staircase which i want the character to climb up or go down the staircase .. how can i do that.

This is something i would be implementing for the first time..so just need some advice.

Share this post


Link to post
Share on other sites
Think of a zone as like the crime scene tape cops use to tell people "stay out of this area". Your game would basically put the player in an area and define lines that the player can't cross. Then you would need to program the game to dis-allow the player from crossing one of those lines. Say the game area is 500x500pixels with coordinate 0,0 for the top-left of the game area. Say you want an area that looks like a long corridor from the bottom left to the top right of the game area. You could define a line from (0, 450) to (450, 0) and another line from (50, 500) to (500, 50).

There's math that can be used to tell which side of a line a point (the player) is on (see here: http://stackoverflow.com/questions/3461453/determine-which-side-of-a-line-a-point-lies ). All your code needs to do is say: on the current frame the player is at point A and wants to move to point B. Are point A and B on the same side of every line in the area? If yes then move the player to point B.

Next up there's figuring out how to deal with objects in the game. You basically need a way to detect whether someone was hovering over/clicked on a select-able in-game object. It's pretty easy to detect this with simple shapes like circles and rectangles (circle: if cursor's distance from a center of a circle is < the radius of the circle then the cursor is in the circle; if the cursor is to the right of the left edge, to the left or the right edge, under the top edge, and above the bottom edge of a rectangle then the cursor is within the rectangle). In fact rectangles are the exact same thing as the lines above if they are rotated so you could probably use the same algorithm. Not all objects are vertical rectangles!

Anyway. If the player hovers a cursor over one of these shapes then change the cursor to a hand to show you can interact with that object. If the cursor is hovered over one of the shapes and clicks on it, perform an action associated with that shape (remove the item from the screen, add it to inventory; move to next screen; unlock door; etc).

Hope this helps you get started.

Share this post


Link to post
Share on other sites
I should say the 'zone' idea can get more complicated. If you have a room that looks like an "L" then you would probably want the player to move from the top part of the L to the bottom right part of the L. The simple algorithm I described would fail in this situation. It doesn't take into account path finding around corners to be able to get to a location. When you get to this point you should look into pathfinding ala A* ( http://www.policyalmanac.org/games/aStarTutorial.htm )

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!