Jump to content

  • Log In with Google      Sign In   
  • Create Account

Troubles drawing on an image with Graphics


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
No replies to this topic

#1 Eckhart   Members   -  Reputation: 108

Like
0Likes
Like

Posted 11 August 2012 - 11:14 PM

I'm working on a game, and I thought color based collision would be a good idea. Now I've got the basic system worked out, but for some reason it just doesn't quite work. Allow me to elaborate. I'm using slick2D and Java, by the way.

Here's the code that should make the image.
http://pastebin.com/3y3Ut0dq
This should work, right? yes, and it does, but only if it's called in a certain way.

This is called in the update method, near the bottom.
http://pastebin.com/gjG4wvRx
http://pastebin.com/1uG82VX0

Of course, I should be able to just call it in the init method, but that doesn't work and in the off-chance that something weird is happening with the init method I just put it in the update method. When I render the collision map, nothing shows up.
http://pastebin.com/8C5ATQGQ

But then, if I create a collision map in the render method as shown, the collision map shows up exactly how it's supposed to.
http://pastebin.com/Pp526J73

If I load the player's collision map in the render method or set the player's collision map to a collision map made in the SimpleGame class, it still doesn't work. Any help would be very appreciated, feel free to ask for more code. By the way, the Game Class is SimpleGame, MapHandler has the CollisionMap method, and Player is a class that holds mapChange().

Thanks in advance.

Edited by Eckhart, 12 August 2012 - 12:42 PM.


Sponsor:



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