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! / Scrolling Backdrop

Author
Message
Orange Verdancy
19
Years of Service
User Offline
Joined: 19th Oct 2006
Location:
Posted: 20th Oct 2006 03:03
I'm making a third person top down game, can you possibly give me examples of how I can make the background change while the character, who will stay in the middle of the screen, moves around? Thanks!
Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 20th Oct 2006 11:20
Do you want it tiled (many small images) or just a huge single image?
Orange Verdancy
19
Years of Service
User Offline
Joined: 19th Oct 2006
Location:
Posted: 20th Oct 2006 17:59
Yeah, probably just one single image would be easier for what I'm doing. Also, I have another question that I've been trying to think about. I'm not going to have a cursor, but I'm going to have an aiming crossair that will rotate around your character according to where you move your mouse. It should rotate in a circular path that is fixed around the character about 30 pixels around from him. Have any ideas? Thank you!
Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 20th Oct 2006 23:35
For a single big image all you have to do is paste the image to the screen. Just keep variables for the x and y of the image so when you move it increases or decreases the backgrounds coordinates.



To get circular paths of anything you need to use "sin" and "cos".

Mr Tank
23
Years of Service
User Offline
Joined: 25th Nov 2002
Location: United Kingdom
Posted: 21st Oct 2006 18:35
Your question seems a bit vague. Usually with a top down game you move the player and camera around and the level stays put, so in the camera it naturally moves.
In my game i have a system whereby the player stays at the origin, the enemies are positioned relative to it, and the backdrop (of stars) is on a static plain object, and is moved using the "scroll object texture" command. I implemented the system this way because it seemed like the easiest way to have a "wrapping" world.


You'll be able to click on this someday.
Orange Verdancy
19
Years of Service
User Offline
Joined: 19th Oct 2006
Location:
Posted: 23rd Oct 2006 05:14
Grog,
Thank you very much, your code is very informative. I understood the concept of the 2d game of how the screen should move, but wasn't sure how to create it via Dark Basic. I'm new to Dark Basic, but I've programmed in Java and some MIPS Assembley. Anyway, I have another question for you, how should I create the fire the weapon function? Thank you!

Mr Tank,
I figured that that is what actually happens during a 2d game, that the character is moving (in a sense), but actually the camera above him needs to move and therefore load either the next tiles or more of the image.

Sorry if any of my questions are vague and thank you both!
2D Analyst
AGK Developer
22
Years of Service
User Offline
Joined: 2nd May 2004
Location:
Posted: 23rd Oct 2006 22:31 Edited at: 23rd Oct 2006 22:38


I haven't tested the above code..but it should work

www.simpoware.com
Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 24th Oct 2006 00:47
Quote: "Anyway, I have another question for you, how should I create the fire the weapon function? Thank you!"


If you're wanting to use the target around your character you can just check collision on that sprite whenever you hit spacebar (or whatever key).
Orange Verdancy
19
Years of Service
User Offline
Joined: 19th Oct 2006
Location:
Posted: 24th Oct 2006 01:34
Alright, thank you guys, I think I figured it out last night. For right now I understand and I need to create my media probably before going farther. Looking in the future though, how could I setup a function or an object as my A.I. enemies that will be numerous across my map? Sorry about all the questions and I appreciate your guys' help. I'm sure I could figure this out, but I would like to know the most efficient way for programming bigger game later on.

Login to post a reply

Server time is: 2026-07-05 05:01:32
Your offset time is: 2026-07-05 05:01:32