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.

Dark GDK / I need some one to answer this NOW please!

Author
Message
Oster200
13
Years of Service
User Offline
Joined: 21st Jan 2011
Location:
Posted: 18th Mar 2011 03:48
okay i had another forum thing but im still having troubles...

Okay i wanna know if there is a better way to make a lot of sprites i dont want to keep writing dbSprite(1,0,0,1); dbSprite(2,0,0,1); over and over for every sprite and i dont want to stretch a sprite im making 2d platform and this would be like the platform that you run on.

i heard you could have arrays to do this but can i have step by step instructions
Cas
13
Years of Service
User Offline
Joined: 12th Nov 2010
Location:
Posted: 18th Mar 2011 04:34
I can't help you with your array but you shouln't be so blunt/harsh with your request. No one will help you if you demand an answer.
WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 18th Mar 2011 05:18
Brash... but please anyway...

I did notice the other post but without any extra info about your original setting up of your sprites there's not much to go on.

Are you setting up the same sprite multiple times?

Are you laying out a level to be displayed on the screen?

What have you got so far?

Warning! May contain Nuts!
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 18th Mar 2011 18:59
Look up the vector library for C++.
http://www.cplusplus.com/reference/stl/vector/vector/

I'm not giving you step by step instructions but this should give you a start.

"everyone forgets a semi-colon sometimes." - Phaelax
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 18th Mar 2011 22:00
Unhelpful Titles

Please do not simply write "Noob Question", "I am a newb", "One Noobie Question", "A question", "Please help", "This isn't working" or anything similar as the title of your post. We have a search facility, and meaningless titles do not help others find answers to their questions. It will also help you to get quicker responses if people have an idea of your thread content.

F4SHAD0
13
Years of Service
User Offline
Joined: 28th Jan 2011
Location: Behind You
Posted: 18th Mar 2011 23:23
Not quite sure if this is what you're looking for, but have you tried



As far as positioning them go, I have no idea.

And BatVink is right, your post title does not help anybody who may have a similar question/problem.
Oster200
13
Years of Service
User Offline
Joined: 21st Jan 2011
Location:
Posted: 19th Mar 2011 03:13 Edited at: 19th Mar 2011 03:15
as far as the title goes its just that i felt that i tried every thing. i know i probaly should not take it out on a forum. ill keep that in mind. thank you to every one that responded to my question ill have to look at them all.

oh and on my other post i put my whole code so yeah...
Pilz X Schizo
17
Years of Service
User Offline
Joined: 21st Mar 2007
Location: Massachusetts, USA
Posted: 20th Mar 2011 23:50
Well it depends a little on if you have a consistant flat platform for your level or if it's somewhat like mario or something with platforms at various heights.

if you just have a flat consistant platform for your level then just use a for loop to draw it out.

int i;
for(i=1; i<50; i++){
sprite(i, i*SpriteWidth, PlatformHeight, ImgageNum);
}


now for a more complex multi-platform type level you will need to set up an array with your level data then use 2 for loops to generate the level. You can have 0=nothing and 1=platform.

LevelData[50][50];
int x, y = 0;
int i = 1;
for(y=0; y<50; y++){
for(x=0; x<50; x++){
if(LevelData[x][y]==1){ sprite(i, x*SpriteWidth, y*SpriteHeight, ImageNum); i++; }
}
}


I dont use the sprite commands so I know that isnt the correct way to use sprites, but it may give you a better idea of how to go about this. It can also be optimized better to only draw what is on the screen instead of the entire level. Hopes this helps you out some.

Oster200
13
Years of Service
User Offline
Joined: 21st Jan 2011
Location:
Posted: 22nd Mar 2011 05:43
Okay that works but how can i move all those sprites down on the bottom of the screen?

Login to post a reply

Server time is: 2024-09-28 12:42:10
Your offset time is: 2024-09-28 12:42:10