noah
PooP MonkeeH
Posts: 8
|
Post by noah on Jun 30, 2017 6:40:11 GMT -5
I've been trying to make a mini game and came up on a problem, tiles. I can seem to only get 32x32 tiles and I have no idea on how to multiply them without making another propsprite ect. Is there away to multiply sprites one after another? Also how could I put in sprites bigger than 32x32? Thanks! Code: pastebin.com/raw/s9L8CFg6
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jun 30, 2017 10:19:04 GMT -5
No, sprites can only be 32x32 pixels (or 4x4 tiles) in size. You'll have to create additional sprites to construct a larger image. This is a limitation of the hardware, so there's no "simple" way around it, ya know?
|
|
noah
PooP MonkeeH
Posts: 8
|
Post by noah on Jun 30, 2017 10:52:49 GMT -5
No, sprites can only be 32x32 pixels (or 4x4 tiles) in size. You'll have to create additional sprites to construct a larger image. This is a limitation of the hardware, so there's no "simple" way around it, ya know? Ahh, guess you're right. My apologies then. Welp I hope I can figure that out
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jun 30, 2017 12:28:58 GMT -5
Are you trying to draw backgrounds or characters/sprites?
You can always use a background layer for a huge "sprite", but if you need more than 1 huge "sprite", then that wouldn't solve your problem.
|
|
noah
PooP MonkeeH
Posts: 8
|
Post by noah on Jun 30, 2017 16:20:15 GMT -5
Are you trying to draw backgrounds or characters/sprites? You can always use a background layer for a huge "sprite", but if you need more than 1 huge "sprite", then that wouldn't solve your problem. It would sorta be a background, I was planning on making a ground sorta like on sonic 1/2. But I really don't know much on how to do that
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jun 30, 2017 16:22:36 GMT -5
Some games "print" a bunch of tiles to a graphic plane to pretend to have huge sprites. I think I've seen this on games like El Viento. The movement would be pretty chunky as your "sprite" could only "move" around one tile length at a time. I think Cyber Shinobi for the SMS is an example of pure tile based sprite handling. Heck, they may have done that for scrolling as well. Everything seems to move at a tiles length. www.youtube.com/watch?v=BXAZYbgTSdk
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jun 30, 2017 16:37:35 GMT -5
Are you trying to draw backgrounds or characters/sprites? You can always use a background layer for a huge "sprite", but if you need more than 1 huge "sprite", then that wouldn't solve your problem. It would sorta be a background, I was planning on making a ground sorta like on sonic 1/2. But I really don't know much on how to do that Okay, so you'll want to use DrawTile, DrawTiles, or DrawTilesInc. DrawTile draws an individual tile to the background (default is Scroll_A) DrawTiles draws tiles from a tile map to the background DrawTilesInc draws tiles in sequential order in VRAM DrawTile 1,x,y
DrawTiles MyMap,1,x,y,2,2
MyMap: Data 0,1 Data 2,3
DrawTilesInc 1,x,y,5,2
Hope this helps!
|
|
noah
PooP MonkeeH
Posts: 8
|
Post by noah on Jun 30, 2017 17:06:59 GMT -5
It would sorta be a background, I was planning on making a ground sorta like on sonic 1/2. But I really don't know much on how to do that Okay, so you'll want to use DrawTile, DrawTiles, or DrawTilesInc. DrawTile draws an individual tile to the background (default is Scroll_A) DrawTiles draws tiles from a tile map to the background DrawTilesInc draws tiles in sequential order in VRAM Hope this helps! Hmm I don't think I'm understanding this right, I've used drawtilesinc but i'm getting an odd result even after looking at the docs. i.gyazo.com/ece2261a6d75c40793fdaf9ab99fec1a.pngcode: pastebin.com/raw/8XDCaPVQ
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jun 30, 2017 19:12:10 GMT -5
Gah, apologies, the X and Y coordinate are the tile x and y, not pixel coordinate.
So with DrawTilesInc, you'd want to do:
DrawTilesInc 576,25,25,2,2
576 = VRAM location (you had this right) 25 (the first one) is the X coordinate to draw the tile (1 tile = 8x8 pixel square) 25 (the second one) is the Y coordinate (same info as the X, just applied to the Y axis) 2 (the first one) is the width of how many tiles you want to draw 2 (the second one) is the height
Using 20x20 would make the command think it's drawing 400 tiles in sequential order.
Each background plane is 64x64 tiles in size, with only 40 tiles visible in the X direction and 28 visible tiles in the Y direction (NTSC, PAL can display another 2 rows or so).
So with your (200,200), that translates to (11,11) because it "loops" once you reach the 64th space back to 0.
Also, when you're exporting your tiles from SGTD!!, the orientation it exports (horizontal or vertical) will also determine how it will be displayed with DrawTilesInc (you'll want to switch tiles 1 and 2 in your code to match SGTD!!)
|
|
|
Post by wraith on Jun 30, 2017 20:32:06 GMT -5
Here's an example 16x16 pixel block map and 48x48 sprite you can play with. MapData.zip (3.03 KB)
|
|
noah
PooP MonkeeH
Posts: 8
|
Post by noah on Jul 1, 2017 8:42:10 GMT -5
Here's an example 16x16 pixel block map and 48x48 sprite you can play with. Awesome! I got alot of questions but to make it short, can you explain what this means? for x=0 to 19
for y=0 to 15
read tile
DrawTiles block,tile<<2+256,x<<1,y<<1,2,2
next
next
Also I've never worked with anything like map_data or the blocks label. How does that stuff work? (Sorry I'm such a noob at this stuff)
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jul 1, 2017 9:42:52 GMT -5
The way his code works is like this: First, For...Next loops repeats itself a specific number of times, in this case, the first loop executes 20 times (0 through 19, each iteration, X increases by 1), and the 2nd loop is done 16 times. The X and Y variables are also being used as tile coordinates with the DrawTiles command.
The Read tile is because (I'm assuming this is present as I haven't looked at his example) there's a line that says Reload (maybe Restore) "map_data" (this can be done in many different ways). What Read tile does is reads the data at the map_data (using Data statements), which increases the data pointer by 1 so you can read the next piece of data. If DataInt was used, you'd need to use ReadInt instead.
The DrawTiles draws the tile map "block:" with the data from Tile as the VRAM location. Tile<<2 means logical shift left by 2 places (it's a binary operation, so if tile = 2, then tile<<1 = 4, and tile<<2 = 8, then the addition of 256 is added to the VRAM location. The x<<1 and y<<1 are because (again, I'm assuming the block: uses a 2x2 tile map, so this is to make sure the tile data isn't overwritten), and then the 2,2 is the height and width of the tile map "block:".
Yeah, I can definitely see how this might be confusing for a beginner. It's pretty easy once you learn how things work, but even the "simple advanced" things like logical shifts may seem overwhelming at first.
|
|
noah
PooP MonkeeH
Posts: 8
|
Post by noah on Jul 1, 2017 10:14:53 GMT -5
The way his code works is like this: First, For...Next loops repeats itself a specific number of times, in this case, the first loop executes 20 times (0 through 19, each iteration, X increases by 1), and the 2nd loop is done 16 times. The X and Y variables are also being used as tile coordinates with the DrawTiles command. The Read tile is because (I'm assuming this is present as I haven't looked at his example) there's a line that says Reload (maybe Restore) "map_data" (this can be done in many different ways). What Read tile does is reads the data at the map_data (using Data statements), which increases the data pointer by 1 so you can read the next piece of data. If DataInt was used, you'd need to use ReadInt instead. The DrawTiles draws the tile map "block:" with the data from Tile as the VRAM location. Tile<<2 means logical shift left by 2 places (it's a binary operation, so if tile = 2, then tile<<1 = 4, and tile<<2 = 8, then the addition of 256 is added to the VRAM location. The x<<1 and y<<1 are because (again, I'm assuming the block: uses a 2x2 tile map, so this is to make sure the tile data isn't overwritten), and then the 2,2 is the height and width of the tile map "block:". Yeah, I can definitely see how this might be confusing for a beginner. It's pretty easy once you learn how things work, but even the "simple advanced" things like logical shifts may seem overwhelming at first. Thanks dude, that rlly helps Yes it is still very confusing but I should learn it in about a couple of days while messing with some code. Sorry for dragging the post on long. Any way, thanks!
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jul 1, 2017 10:18:33 GMT -5
That's why we're all here =) If you're just planning on programming for the Genesis, I would recommend using SecondBASIC instead. It's based off of BEX, but has some updated commands, better help documentation (though it still does need some work) and more features built in (such as the XGM driver is built into SecondBASIC so you just need to add the files and use the new commands). There's also a few more active users on the Second Dimension forums as well. Feel free to check it out if you're interested, you can find it at www.second-dimension.com/sbasic/
|
|
noah
PooP MonkeeH
Posts: 8
|
Post by noah on Jul 1, 2017 10:24:39 GMT -5
That's why we're all here =) If you're just planning on programming for the Genesis, I would recommend using SecondBASIC instead. It's based off of BEX, but has some updated commands, better help documentation (though it still does need some work) and more features built in (such as the XGM driver is built into SecondBASIC so you just need to add the files and use the new commands). There's also a few more active users on the Second Dimension forums as well. Feel free to check it out if you're interested, you can find it at www.second-dimension.com/sbasic/Wow didn't even know about that, I'll definitely check it out!
|
|