So I know in a Tile Based game its more effecient to have static final instances of each tile, then populate your array with those instances. But what about Rendering? You have to pass the position that tile should be rendered into your method you use for rendering. Is there a way for the tile to render from its position in a Tile array? Is passing in a position each render the most effecient way?

Member Avatar
Member Avatar
+0 forum 6

Hi, I am creating a project which is a remake of a game so I want to be able to read a map from a Notepad file and store the location and character in the file so I can place a selected image in the location on the grid that I have already ceated. My text file looks like this: 8,8 00111000 00131000 00101111 11120231 1302c111 11112100 00013100 00011100 The "8,8" is the size of the map. In my game, the player gets to choose the character that they will use (the character is represented in teh text file with …

Member Avatar
+0 forum 0

So I am trying to make a tile map editor/reader to create and interact with maps like [this](http://www.codeproject.com/KB/game/Autotiles_Algorithm/TileMapExample.png) , so essnetially I am wondering what the best way to go about this would be. I have not done anyhting graphical in programming in a long time and yeah, I was thinking an arary of jlabels on a jframe? Anyone have any suggestions / ideas? thanks

Member Avatar
Member Avatar
+0 forum 3

i have a array 10X13. where it say 1 i want to print image called wall. ok so the array part is easy. iam pretty sure its fine. less continue. const int ROWS = 10; const int COLS = 13; int level[ROWS][COLS] = { {1,1,1,1,1,1,1,1,1,1,1,1,1}, {1,0,0,0,0,0,0,0,0,0,0,0,1}, {1,0,0,0,0,0,0,0,0,0,0,0,1}, {1,0,0,0,0,0,0,0,0,0,0,0,1}, {1,0,0,0,0,0,0,0,0,0,0,0,1}, {1,0,0,0,0,0,0,0,0,0,0,0,1}, {1,0,0,0,0,0,0,0,0,0,0,0,1}, {1,0,0,0,0,1,1,0,0,0,0,0,1}, {1,0,0,0,0,1,1,0,0,0,0,0,1}, {1,1,1,1,1,1,1,1,1,1,1,1,1} }; less look at my main part of code. here iam trying to loop through array and where i see 1 paste image. i sound easy but for some reason its not working. dbLoadImage("wall.bmp",1); //wall //dbSprite(2,0,0,2); int x = 0; int y = 0; for(int r …

Member Avatar
Member Avatar
+0 forum 2

for some reason iam not getting the right map. i think the problem is x += 130; y += 130; #include "DarkGDK.h" const int ROWS = 10; const int COLS = 13; int level[ROWS][COLS] = { {1,1,1,1,1,1,1,1,1,1,1,1,1}, {1,0,0,0,0,0,0,0,0,0,0,0,1}, {1,0,0,0,0,0,0,0,0,0,0,0,1}, {1,0,0,0,0,0,0,0,0,0,0,0,1}, {1,0,0,0,0,0,0,0,0,0,0,0,1}, {1,0,0,0,0,0,0,0,0,0,0,0,1}, {1,0,0,0,0,0,0,0,0,0,0,0,1}, {1,0,0,0,0,1,1,0,0,0,0,0,1}, {1,0,0,0,0,1,1,0,0,0,0,0,1}, {1,1,1,1,1,1,1,1,1,1,1,1,1} }; void DarkGDK(void) { dbSyncOn(); dbSyncRate(60); dbDisableEscapeKey(); dbLoadImage("rock.bmp", 1); int x = 0; int y = 0; for(int r = 0; r < ROWS; r++) { x = 0; for(int c = 0; c < COLS; c++) { dbPasteImage(level[r][c], x, y); x += 130; } y += 130; } while(LoopGDK()) { if(dbEscapeKey() == 1) …

Member Avatar
+0 forum 0

I wrote a program that does rudimentary tile mapping based on reading in information from a "map file" and drawing the map on screen. I need it to be drawn in a scrollable window so it doesnt matter how big the grid is defined in the map file. I have looked into autoscroll but i dont see how to get it to work. Here is the code for the non scrollable window: [CODE]Public Class Form1 'Defining the drawing variables, rectangles, bitmaps, etc. 'For drawing both the map grid and the backgrounds/icons Private rect As Rectangle Private rect2 As Rectangle Private …

Member Avatar
Member Avatar
+0 forum 1

Ok, So i wrote this basic program that takes a map file as an input, and parses it and then draws the map. Its sort of like VERY BASIC tile mapping. The problem is, I cant think of a way to loop it so that no matter how many map cells are defined in the file, it will work. Right now i have if then else checks for how many are there, and it works, but its limited to 10 due to the size of the code, and its getting LONG. Is there any way for me to shorten this …

Member Avatar
Member Avatar
+0 forum 4

Hey guys, I am pretty new in using jsp. I am currently using tiles and action mappings for my project. I am just wondering if there is a way to use action mapping with <jsp:forward> or any other forward script, especially in tiles? I tried to do the following and it doesn't work: <jsp:forward page="/welcome.do"> Is there something I should know to make this work? Thanks a lot!

Member Avatar
+0 forum 0

Hi, I have a fancy animated GIF loader that I want to use in projects, but the problem is that the image is only 48x22. Is there some way I can tile the image horizontally to lengthen it? The only solutions I found on the web was with bitmap images. Any ideas? Thanks!

Member Avatar
Member Avatar
+0 forum 1

The End.