Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / How do I set a background for my 2D game ?

Author
Message
Waltzer
19
Years of Service
User Offline
Joined: 8th Aug 2006
Location:
Posted: 29th Sep 2006 21:37
Hello, I'm wondering how I could create a background for my 2D game.

Anybody knows how to do it ?




Thanks for all answers.
Scraggle
Moderator
22
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 29th Sep 2006 22:52 Edited at: 29th Sep 2006 22:52
That's not a very complete question!

You could use a digital camera to get a realistic background or using any paint package you could draw your own or maybe use a 3D package to render your background.
Or is it an animatated background you wish to create? Or a scrolling backdrop?
Or have I missed the mark completely and you have already created the image and the question you are really asking is: "How do I load my image to use as a background?"
Or maybe you have loaded the image and your question really is: " How do I display my image as a backdrop?"

Do you see what I am saying ... your question is a bit pants!


sadsack
22
Years of Service
User Offline
Joined: 27th Nov 2003
Location: here
Posted: 29th Sep 2006 23:01
I am not sure what you want. You can make a background in a paint program, then use this code to put it in your game:



Load image "background.bmp",2 `This load the image you made in your
` paint pro.
Sprite 1,0,0,2 `this put your background on the screen as a
` sprite. The first number is(sprite #),(X),(Y),
`(image number)

you have a background
I hope that is what you want.
renny
Waltzer
19
Years of Service
User Offline
Joined: 8th Aug 2006
Location:
Posted: 29th Sep 2006 23:32
Ohh. sorry guys.
I didn't thought about that when I were writing.

Ok, I have already made my background.
And I want to load it into the screen, so I can move around on the background while playing.

One little more thing.
When I press Leftkey I want the sprite to change between image "playerstickleft.bmp" and "playerstickleft1.bmp"

And when I press Rightkey I want the sprite to change between "playerstickright.bmp" and "playerstickright1.bmp"

Any good solutions for this ? (I now I've asked for this before, but with the answer I got, i just made the sprite to change between
2 images)
aka
When I pressed Rightkey it changed beetween "playerstickright.bmp" and "playerstickright1.bmp". But the problem was that it changed between the same images when pressing leftkey too.
Zergei
21
Years of Service
User Offline
Joined: 9th Feb 2005
Location: Everywhere
Posted: 30th Sep 2006 06:12
Quote: "When I pressed Rightkey it changed beetween "playerstickright.bmp" and "playerstickright1.bmp". But the problem was that it changed between the same images when pressing leftkey too."


Well, go to the part where the LEFT sequence is, and set the image you want, as simple as that.

Further on my stuff at...
Scraggle
Moderator
22
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 30th Sep 2006 10:34 Edited at: 30th Sep 2006 10:48
Don't you remember the code I wrote for you in your other thread about moving a sprite left and right? It did exactly what you are asking. The only difference was that it had eight frames of animation in each direction but now you only want two.

Here is the same code again:

The only thing I have changed is to set the maximum value for the frame variable to 2 instead of 8. I have also added a function to create the animation frames so that you can run it media free instead of downloading the sprite I used last time and you now have a background.


iron_man
19
Years of Service
User Offline
Joined: 14th Dec 2006
Location:
Posted: 21st Dec 2006 01:47
im making a text based rpg, and want pictures of digital towns behind the text. how can i do that? message my profile plz

im new and dont know anything about programming. all i want to do is program games.

Login to post a reply

Server time is: 2026-07-07 14:46:53
Your offset time is: 2026-07-07 14:46:53