Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


[java] Map drawing problem?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 Captain Goatse   Banned   -  Reputation: 100

Like
Likes
Like

Posted 01 May 2000 - 12:42 AM

http://www.geocities.com/opv99/problem.zip Problem is in here, in that algo in Engine.java/drawmap. //For each tile in row for(j=0;j 31) tx = 0; if((ty-=1) < 0) ty = 31; }//for each tile in row screeny+=32; if((i & 1) == 1) { if((mx+=1) > 31) mx = 32; } else { if((my+=1) > 31) my = 32; } I''m compeletely out of answers and questions, too(?). So if you know way to make em'' draw just like they are presented in array OR way to change the drawing algo so that It draws them right, reply, please. Time comes, time goes and I only am.

Sponsor:

#2 Jim_Ross   Members   -  Reputation: 122

Like
Likes
Like

Posted 01 May 2000 - 03:29 AM

GoDEngine intialized
Uncaught error fetching image:
java.lang.NullPointerException
at sun.awt.image.URLImageSource.getConnection(URLImageSource.java:106)
at sun.awt.image.URLImageSource.getDecoder(URLImageSource.java:115)
at sun.awt.image.InputStreamImageSource.doFetch(InputStreamImageSource.j
ava:255)
at sun.awt.image.ImageFetcher.fetchloop(ImageFetcher.java:221)
at sun.awt.image.ImageFetcher.run(ImageFetcher.java:189)

I did ">java rpg", is that right? Why are you getting images with URLs? I tried running a web server on my comp to see if "localhost" was hardcoded in there somewhere, but nope.
Okay, got it, i had to put the images under an images dir

Edited by - Jim_Ross on 5/1/00 9:44:29 AM

#3 Captain Goatse   Banned   -  Reputation: 100

Like
Likes
Like

Posted 01 May 2000 - 04:09 AM

Winzip was supposed to do that, I mean put images under images dir.
It seems to be that getClass().getResource(); does it automatically? Well, anyhow, then how should I do it? With quick review I couldn''t find better way to do, but it''s not the most important thing in this case. Still, why is it drawing it wrong?


Time comes, time goes and I only am.

#4 SteveMeister   Members   -  Reputation: 122

Like
Likes
Like

Posted 01 May 2000 - 06:52 AM

One problem is that when you're drawing the tiles in a cell in drawMap, in your "k" loop

for(k=0;k < map[ty][tx].num;k++)
{
tile_to_draw = map[ty][tx].tile[k];
offScreen.drawImage(grassTiles[tile_to_draw], screenx, screeny, this);
}//for each tile

If you look up in loadMap, you set map[][].num for the various cell types, but you only ever assign one tile to be drawn. For example, in loadMap for a tile of type 5, you set map[_i][j].num to 2, but you only define map[_i][j].tile[0], so I'm surprised you're not getting errors in the for k loop in drawMap.

Also, what's the while loop for in drawMap?


Edited by - SteveMeister on 5/1/00 12:55:35 PM

#5 Captain Goatse   Banned   -  Reputation: 100

Like
Likes
Like

Posted 01 May 2000 - 06:42 PM

That while thing handles layers in real version, but it is useless in here. That transform map doesn''t make any sense, so far. I am surprised by myself, I was almost sure that I knew every single line when I started to transform it from iso view...

Time comes, time goes and I only am.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS