Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Making a game like this?  (Read 1373 times)

0 Members and 1 Guest are viewing this topic.

BeautiCode

  • Jr. Member
  • **
  • Posts: 89
    • View Profile
Making a game like this?
« on: July 11, 2014, 04:31:40 am »
So I'm new to game programming, I've made a few simple things. Now I want to make something big.
I have an idea in mind, the game would look something similar to this


But can you guys give me ideas on how to get it done? My main concern is...
I'm thinking about drawing (let's say...Tree images) onto the screen, but draw multiple ones from the same image and put them like in a certain pattern on the screen, something like above.  And I want to draw a character too, that can move around. I'm thinking that I'm gonna need some sort of loop and/or a dynamically allocated array. But how would I be able to check what image the character is standing/being drawn on? And i I wanted to replace that specific image, how would I do it?
Can you guys like, just give me an idea of how I could get things going? No need to go in deep detail, but you know..
I'd appreciate it.

G.

  • Hero Member
  • *****
  • Posts: 1593
    • View Profile
Re: Making a game like this?
« Reply #1 on: July 11, 2014, 04:54:45 am »
Use a tilemap.
I'm thinking about drawing (let's say...Tree images) onto the screen, but draw multiple ones from the same image and put them like in a certain pattern on the screen
Load a texture, create multiple sprites that use that texture, position them where you want, draw them. :/
(or vertexArrays)
But how would I be able to check what image the character is standing/being drawn on? And i I wanted to replace that specific image, how would I do it?
If your map is a grid (a tilemap), it's easy to compute on what row/column on your tilemap your character is.
column = characterPosition.x / tileWidth
row = characterPosition.y / tileHeight
To replace the image of a sprite, set another texture to it, or set another texture rect.

Have you tried something? If not try first, then ask if you have some real problems because right now "how do I make XXX game?" is pretty vague...
« Last Edit: July 11, 2014, 05:00:26 am by G. »

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Making a game like this?
« Reply #2 on: July 11, 2014, 09:35:30 am »
You may like to read this thread which is linked to your goal and has a lot of discussion about working with tiles. Specifically, have a look at this post that has some visual reference to help understand how the TileMap in the tutorial works.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

 

anything