Okay, so I've been writing my Crusader RPG, and need to just finish it, but seeing everyone using ICE to do cool things... I had to join in. A week or so ago I made a simple game in ICE. While I could not get 32*32 sprites to work, I had a tilemap of scaled 16*16 sprites, a moving character, and collision detection.
But I have some questions. First of all, how do I make a scrolling map? Lists can only hold 999 numbers, no where near enough to make a large map. In my test I made 2 rooms you could move between through a door, but that was all. I can understand the concept of a large map that only has a small part of it drawn on the screen depending on where the character is, but how do you hold the information for the rest of the map?
ICE lists can hold more than 999 numbers Smile
***Pieman7373 drops the mic
You could split it up into smaller lists, but that is a pain.

Strings can hold as many chars as memory will allow, however.
Can ICE lists hold 9,999 characters? Because that would be enough for a small map. Also, if I would choose to use strings, do the expr( and sub( commands work with ICE?

BTW, how do you guys make your sprites? I have been making them in Excel and saving them as a PNG, but if I actually want to make a game that's going to have to change...
If you start with L5, you can use 23030 elements, or if each element can hold 3 characters, 69090 characters. Both expr( and sub( does not work with ICE. And for creating sprites, just use Paint, or Photoshop, or whatever Razz
Time to debug! I need some help, so please bear with me.
What I have so far is List5 storing a 100*100 map, which the x and y cords translate to (an x value of 50 and y of 40 = (40-1)*100+50. When you move (which isn't in the code I am about to post) the screen should redraw by storing the area directly around the character (say an 8*10 or whatever the calculator screen will show) in List2 and then drawing that. So List2 holds about 100 characters while List5 holds 10000.
Unfortunately, this isn't working. I believe the main problem is transferring the correct data from List5 to List2.

Link to download the code, I am also posting it below.
https://github.com/dankcalculatorbro/PixelDungeonPort


Code:

P //I don't think I can use an imaginary i on Cemetech

//DefineSprite goes here. Sprite 0 is the character while Sprites 1 and 2 are the walls and floor. Sprites are referenced as S later on

det(0)
det(5,0)

For(X,1,10000) //Fills main map with walls and zoomed in map with nothing
2→L₅(X)
End
For(X,1,100)
0→L₂(X)
End

1→L₅(1)  //Makes a small 2 by 2 square of floor in the top right of the main map, to see if everything is aligned
1→L₅(2)
1→L₅(101)
1→L₅(102)



2→Y //stores x and y coords. 0>x>101, same with y
2→X

0→S
0→A

For(N,Y-1,Y+1)   //in theory stores area around the character in List2. Here I am only trying to store 9 values
For(O,X-1,X+1)
A+1→A
L₅(((N-1)*100)+O)→L₂(A)
End
End

det(5,0)

For(O,1,3) //draws what is in List2, again only a 3 by 3 square. If nothing in the List is changed a character will be drawn since L2 is filled with 0
For(N,1,3)
L₂(N+(10*(O-1)))→S
det(62,S,((N-1)*32),((O-1)*32),2,2)
End
End

Pause
det(1)
The problem was in the display for( loops, but being unable to find a fix, I have written out each specific command. Doesn't slow it down, but takes up more memory. I cannot upload gifs as I have trouble building CEmu with QT, but will post a short video when I edit this post later.

BBC code is not being my friend so here's a link to the vid:
https://youtu.be/MZS2xqMInFI
dankcalculatorbro wrote:
The problem was in the display for( loops, but being unable to find a fix, I have written out each specific command. Doesn't slow it down, but takes up more memory. I cannot upload gifs as I have trouble building CEmu with QT, but will post a short video when I edit this post later.

Um you do know that there are builds of CEmu that you can download? You don't need t o build it from the source Wink
How does such a thing work? Could you link me? I was just downloading off of GitHub and followed the readme the best I could. (I use Windows 10).
CEmu builds for 32-bit and 64-bit windows Smile
Ok, this has nothing to do with programming and lists and stuff to help you. I just have a question. Are you making a remake of Pixel Dungeon or Crusader RPG? Because I'm making a remake of Pixel Dungeon after I finish Snake... Well at least a somewhat different clone of Pixel Dungeon
TheGeekyScientist wrote:
Ok, this has nothing to do with programming and lists and stuff to help you. I just have a question. Are you making a remake of Pixel Dungeon or Crusader RPG? Because I'm making a remake of Pixel Dungeon after I finish Snake... Well at least a somewhat different clone of Pixel Dungeon

I am making a clone of Pixel Dungeon. Here is a screenshot. So far all I have is movement around a 100 by 100 map and collision detection. If you wanted to collaborate though I could use help with random world generation and other things...

I could help... But later in approximately a month. My exams are this week and then I'm free. But I have to finish my Snake game which will be in ICE. I may not be very helpful with programming, but I could help a lot with graphics. I'm really good at pixel art. But as I see, I think you have some nice graphics and some good code. I could try to see what I could do later.

That gif should work. Btw, thank you so much Mateo for linking me to the CEmu. Graphics - I need to work on them. I don't know if I like the black screen being erased as you explore more. Originally I had it so that the entire map was visible and you didn't have to move around, but I was trying to keep it close to the real game. I can't edit it a lot right now, as I still have 3 finals to take, but will have more time soon.
Look's great right now. Are you going to add doors? They are pretty pointless but maybe you should have it like a barrier and the player has to press enter to open the door. You sure do have a great start though. Looks amazing... (just as good as Pieman's Dragon Warrior)... but you still got a lot to work on. Are you adding a thing where you can save your games progress or does it automatically save... Like, have 3 options, slot 1, slot 2, slot 3. Then you can save your progress and play 3 different games.
Doors I will definitely add, and probably long grass as it is integral to the game, but sprites take up a lot of space, so some of the special floors and walls (wood, short grass, water, more brick-like structure as levels increase) might have to be left out. I'll have to see. There is currently no save feature, random world generation and an inventory would probably be my priority. There will probably be only one game save.
Sigh* If only you could get a calculator with loads of memory. Welp. I guess you can't go very far with details... but it's still going to be good. I'll try to see if my idea will work for the move around to see what's ahead part.
Okay, so some issues with the inventory: the getkey is setup so that the spot you have selected is only changed if you are moving not past the limit (it only allows you to move the selection right if x<238). However, X seems to be able to exceed this value (especially if the key is held down).

Code:

iTEST

det(0)    //Here until the While loop just sets up the screen
det(5,0)
det(2,11
det(36,35,25,251,200
det(2,12
For(X,37,237,50
For(Y,27,217,50
det(36,X,Y,46,46)
End
End


37→X→S //Starting X and Y cords, S and T are for erasing the old selection after you move
27→Y→T
det(2,9
det(36,X,Y,46,46
0→G
While G≠54 //Main loop
If X≠S or Y≠T //Redraw if X and Y have changed
det(2,9
det(36,X,Y,46,46
det(2,12
det(36,S,T,46,46
End
getKey→G
X→S
Y→T
If G=3 and X<237 //X has to be less than 237, why can it exceed that value?
X+50→X
End
If G=2
X-50→X
End
End
det(1)

Code:
If G=3 and X<237
X+50->X
End
If G=2
X-50->X
End
If X>237
237->X
End
End

You could try adding that Razz
Well, that seemed to work. Thank you! Very Happy
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 2
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement