Author Topic: Few simple questions  (Read 18099 times)

0 Members and 2 Guests are viewing this topic.

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: Few simple questions
« Reply #30 on: May 26, 2012, 04:54:39 pm »
I don't quite get what you mean.... do you mean how to make the sprites? Or how to make a tile-map and then scrolling a scrolling map?

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline stevon8ter

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 663
  • Rating: +10/-0
    • View Profile
Re: Few simple questions
« Reply #31 on: May 26, 2012, 04:57:15 pm »
I mean how to make a tile map and then scrol a scrolling map (sprite stays on the same place of the screen, so there isn't a sprite-movement but a scrol-movement)

And how about the sprite's x and y, what corner is it?
None of my posts are meant offending... I you feel hurt by one of my posts, tell me ... So i can appoligise me and/or explain why i posted it


Hi there, I'm the allmighty (read as: stupid, weak...) STEVON8TER

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: Few simple questions
« Reply #32 on: May 26, 2012, 05:01:56 pm »
Well, first to drawing a tilemap...
xLib has a nice function for it :D
copied from the readme
Spoiler For tilemap:
2 - DrawTileMap:
----------------
usage: real(2,Matrice_Name,X_Offset,Y_Offset,MapWidth,MapHeight,ScreenStartX,
ScreenEndX,ScreenStartY,ScreenEndY,mPIC_Num,Tile_Method,Tile_Size,Map_UpdateLCD

Matrice_Name = Name of matrice containing map data 0 - 9. 0 = [A] - 9 = [J]
X_Offsett = X Map Offsett. Which part of the map you wish to start drawing at
Y_Offsett = Y Map Offsett. Which part of the map you wish to start drawing at
MapWidth = Width of TileMap
MapHeight = Height of TileMap
ScreenStartX = Which COLUMN you wish to START drawing. Can be a value from 0-12 for 8x8 or 0-6 for 16x16
ScreenEndX = Which COLUMN you wish to END drawing at. Can be a value from 0-12 for 8x8 or 0-6 for 16x16
ScreenStartY = Which ROW you wish to START drawing. Can be a value from 0-8 for 8x8 or 0-4 for 16x16
ScreenEndY = Which ROW you wish to END drawing at. Can be a value from 0-8 for 8x8 or 0-4 for 16x16
mPIC_Num = The PIC in which the tile data is located PIC0 - PIC255
Tile_Method = The copy method 0 = Overwrite, 1 = AND, 2 = OR, 3 = XOR
Tile_Size = Size of tiles, 8 = 8x8, 16 = 16x16
Map_UpdateLCD = Toggle LCD update 0 = No, 1 = Yes

The ScreenStartX, ScreenEndX, ScreenStartY, ScreenEndY enable you to draw a 'windowed' map. This means that you can draw
your map and leave space for a HUD or something similar. Drawing smaller maps will also be a little faster.

To draw an 8x8 tilesize map centered with a 1 tile blank border the inputs would be:

ScreenStartX = 1
ScreenEndX = 11
ScreenStartY = 1
ScreenEndY = 7

The TileMap routine now supports MULTIPLE PICS and 16-bit TILE INDEX's. This means that you can have a map with more than
256 different tiles. If a tile is >95 it will overlap to the next PIC (if it exists).

PICS must follow each other numerically!!!!

So if your input PIC is PIC0 any tiles > 95 will be taken from PIC1 and any tiles > 191 will be taken from PIC2.

If the PIC doesnt exist then the tile will be drawn as a BLANK.

This function will still be able to read PIC data even if it is archived! But it may slow things down.
So, with scrolling, I'd do that you have a grand matrix with the full map in it, and into a second matrix is copied what must be displayed on the screen, which is used then for the tilemap function. Then I would place the sprite for the character in the center using the overwright logic and then update the LCD.

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline stevon8ter

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 663
  • Rating: +10/-0
    • View Profile
Re: Few simple questions
« Reply #33 on: May 26, 2012, 05:24:04 pm »
I don't really get it, if you once have time (now or tommorow or whenever, could you give me an example of tilemap + scrolling? Sorry to bother you with my n00b questions
None of my posts are meant offending... I you feel hurt by one of my posts, tell me ... So i can appoligise me and/or explain why i posted it


Hi there, I'm the allmighty (read as: stupid, weak...) STEVON8TER

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: Few simple questions
« Reply #34 on: May 27, 2012, 04:43:14 pm »
Ok, do already know how to use matrixes?

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline stevon8ter

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 663
  • Rating: +10/-0
    • View Profile
Re: Few simple questions
« Reply #35 on: May 27, 2012, 04:56:37 pm »
Not really, but now i allready installed xlib, yeey :P
None of my posts are meant offending... I you feel hurt by one of my posts, tell me ... So i can appoligise me and/or explain why i posted it


Hi there, I'm the allmighty (read as: stupid, weak...) STEVON8TER

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: Few simple questions
« Reply #36 on: May 27, 2012, 04:59:36 pm »
Ok, matrices can be used just as two-dimensional lists. You have in total 10 matrices (with xTravar up to 255 :P)
Well, you can defind them like this:
Code: [Select]
[[5,6,8][8,6,2][3,5,2->[A]As you can see this is a 3x3 dimensional matrix that is stored in A.
You can call the single thingys like this: [A](row,column)   (row and column may be the other way around, dunno D: )
you can also define them like that
Get it?

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline stevon8ter

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 663
  • Rating: +10/-0
    • View Profile
Re: Few simple questions
« Reply #37 on: May 27, 2012, 05:02:13 pm »
Yeah, get that
None of my posts are meant offending... I you feel hurt by one of my posts, tell me ... So i can appoligise me and/or explain why i posted it


Hi there, I'm the allmighty (read as: stupid, weak...) STEVON8TER

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: Few simple questions
« Reply #38 on: May 27, 2012, 05:07:36 pm »
Ok, now you can use that to store tiles in it, twelve across and 8 down, for 8x8 tiles.
Now, you have in a pic all the tiles stored.
0 would draw then the first tile, 1 the second one etc. 96 and greater automaticly fetch from the next pic.
so, now you have:
real(2,0(if you use [A]),0,0,0,12,0,8,<picnum>,0(method),8,1)
Caution: I didn't try this out now, it may crash, as wrong drawing of tilemaps in xlib can make the calc crash.

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline stevon8ter

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 663
  • Rating: +10/-0
    • View Profile
Re: Few simple questions
« Reply #39 on: May 27, 2012, 05:21:18 pm »
Is it like: one tile has to be in the pic and then it always takes the same tile or does the tilemap has to be in the pic allready completely?
And the matrix has to be preset with the numbers you've set in the previous post?
None of my posts are meant offending... I you feel hurt by one of my posts, tell me ... So i can appoligise me and/or explain why i posted it


Hi there, I'm the allmighty (read as: stupid, weak...) STEVON8TER

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: Few simple questions
« Reply #40 on: May 27, 2012, 05:23:35 pm »
Well, you have in the pic then all your tiles you wanne use, e.g. grass, roads, etc.
then the one in the top left corner is represented by the number 0, the one left to it with 1 etc.
Now the matrix has all the numbers in the way it should be displayed in the correct positions.
Nope you get it :)

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline stevon8ter

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 663
  • Rating: +10/-0
    • View Profile
Re: Few simple questions
« Reply #41 on: May 27, 2012, 05:28:18 pm »
And how does the matrix interpretes (wrongly spelled) it? Oike the left-above matrix is the left above tile where he places the tile-number?
None of my posts are meant offending... I you feel hurt by one of my posts, tell me ... So i can appoligise me and/or explain why i posted it


Hi there, I'm the allmighty (read as: stupid, weak...) STEVON8TER

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: Few simple questions
« Reply #42 on: May 27, 2012, 05:31:34 pm »
Yep, so for the full screen you need a matrix the size of 12*8, and then everything is then just exactly copied.

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline stevon8ter

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 663
  • Rating: +10/-0
    • View Profile
Re: Few simple questions
« Reply #43 on: May 27, 2012, 06:18:58 pm »
But in the real( are standing 11 numbers, in xlib's tutorial are standing 14 numbers
None of my posts are meant offending... I you feel hurt by one of my posts, tell me ... So i can appoligise me and/or explain why i posted it


Hi there, I'm the allmighty (read as: stupid, weak...) STEVON8TER

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: Few simple questions
« Reply #44 on: May 27, 2012, 06:22:43 pm »
ups, sorry

usage: real(2,0,0,0,96,64,0,12,0,8,<picnum>,0,8,1
and the matrix, as a tilemap for the full screen would be then 12 tiles across and 8 tiles down your matrix will be 12 across and 8 down
Code: [Select]
[[2,1,1,1,1,1,1,1,1,1,1,1][1,1,1,1,1,1,1,1,1,1,1,1][1,1,1,1,1,1,1,1,1,1,1,1][1,1,1,1,1,1,1,1,1,1,1,1][1,1,1,1,1,1,1,1,1,1,1,1][1,1,1,1,1,1,1,1,1,1,1,1][1,1,1,1,1,1,1,1,1,1,1,1][1,1,1,1,1,1,1,1,1,1,1,1][1,1,1,1,1,1,1,1,1,1,1,1][1,1,1,1,1,1,1,1,1,1,1,1][1,1,1,1,1,1,1,1,1,1,1,1][1,1,1,1,1,1,1,1,1,1,1,1]]->[A]that would fill it with the tile 1 and just in the top left corner have the tile 2.

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!