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.

Newcomers DBPro Corner / newbie 2d question

Author
Message
fllwthewolves
12
Years of Service
User Offline
Joined: 4th Sep 2011
Location:
Posted: 30th Oct 2011 03:16
ok so im fairly new to the world of programming and i was working on a game that is a top down view of my character (i know it sounds ridiculous but the pokemon red/blue games are a good idea of what im talking about) but i need my sprite to turn/rotate when i move left and right i was wondering what the best way to do that would be.

also if you know of any programs that would make level creation (in 2d top-down) easier please let me know of it. thanks and any help is gladly appreciated.
Hodgey
14
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 30th Oct 2011 06:55
There are a couple of ways to do this. You can use the ROTATE SPRITE command to rotate your sprite upon a keypress such as:



or you could draw the different angles into the sprite's animation and change frames according to the input.

As for drawing programs I like Tile Studio for drawing these kinds of things.

fllwthewolves
12
Years of Service
User Offline
Joined: 4th Sep 2011
Location:
Posted: 30th Oct 2011 07:27
Quote: "
There are a couple of ways to do this. You can use the ROTATE SPRITE command to rotate your sprite upon a keypress such as:

"


sorry i diddnt mention this before but i tried the rotate sprite command and the problem i ran into was that it was rotating the sprite around its 0,0 coordinate instead of the center of the sprite like i need it to. any suggestions?

also thanks for the link to tile studio it looks like exactly what iv been looking for.
Hodgey
14
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 30th Oct 2011 13:20
Quote: "sorry i diddnt mention this before but i tried the rotate sprite command and the problem i ran into was that it was rotating the sprite around its 0,0 coordinate instead of the center of the sprite like i need it to. any suggestions?"

Yep and you can change that 0,0 coordinate by using the OFFSET SPRITE command. Try this:

OFFSET SPRITE mysprite, SPRITE WIDTH(mysprite)/2, SPRITE HEIGHT(mysprite)/2

and then use your rotation commands.

Quote: "also thanks for the link to tile studio it looks like exactly what iv been looking for. "

You're welcome.

fllwthewolves
12
Years of Service
User Offline
Joined: 4th Sep 2011
Location:
Posted: 1st Nov 2011 07:11
you wouldnt happen to know where i could find a tutorial on tile studio would you? i looked at theirs and really couldnt gain much from it espicially being new to all this.
Hodgey
14
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 1st Nov 2011 11:09
Quote: "you wouldnt happen to know where i could find a tutorial on tile studio would you? i looked at theirs and really couldnt gain much from it espicially being new to all this. "

Nope, I just used theirs. There are two editors though. One for making a map and one for creating tiles. Once you have created a few tiles, you then use those tiles to build a map.

fllwthewolves
12
Years of Service
User Offline
Joined: 4th Sep 2011
Location:
Posted: 2nd Nov 2011 07:19
Quote: "Nope, I just used theirs. There are two editors though. One for making a map and one for creating tiles. Once you have created a few tiles, you then use those tiles to build a map"


well i know how to use the program that was pretty simple. what i cant seem to figure out is how to implement them into my games. i tried generating the code and then copying the file to my directory where i then #include it. and then Gosub Init_Tile_Studio_Library[b][/b]

but it gives me the error

Quote: "
User function declaration must use no spaces, no numerical first character and include a set of brackets inside map1_include.dba.
"
EricB
12
Years of Service
User Offline
Joined: 3rd Nov 2011
Location:
Posted: 16th Nov 2011 12:52
Quote: "but it gives me the error

Quote: "
User function declaration must use no spaces, no numerical first character and include a set of brackets inside map1_include.dba.
""


While I am definitely a neophyte when it comes to DBP I believe the error is indicating that you are missing a set of brackets in the function section of included file "map1_include.dba".
zenassem
21
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 16th Nov 2011 18:20 Edited at: 16th Nov 2011 18:25
Quote: "but it gives me the error

"User function declaration must use no spaces, no numerical first character and include a set of brackets inside map1_include.dba.
""


The reason you are getting that error is because the code generation file dbpro.tsd is no longer correct.

I recently (9/2/11) updated the .tsd,, I'll add it to this post as well.

Your signature has been erased by a mod please reduce it to 600 x 120.

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-05-20 04:39:45
Your offset time is: 2024-05-20 04:39:45