Forum Settings
Forums

Help noob programmer test his first videogame?

New
Dec 4, 2016 3:36 PM
#1

Offline
May 2014
1740
It runs java btw so make sure you have that (and it may need to be up to date)

basically just tell me what happens when you run it. my friend said it wouldnt start for him but my other friend said it did.

http://s000.tinyupload.com/?file_id=12913148416442740063 (updated 12/6)

what you should get:


-its a basic RTS with simple pathfinding and water/grass tiles for terrain.
-you are green. enemy units are red
-left click to select units (you can drag a box around them)
-right click to make them move
-WASD to move camera
-UI panel on left has controls. units have attack-move and stop
-the building can build units via the left panel
joey101937Dec 6, 2016 8:30 PM
Dec 4, 2016 4:32 PM
#2

Offline
Oct 2014
3645
the game screen is too big I can't see anything and you may want to get rid of those message boxes
here's the output
javax.imageio.IIOException: Can't read input file!
at javax.imageio.ImageIO.read(ImageIO.java:1301)
at pkg2dgame.GameObject.createSprite(GameObject.java:95)
at pkg2dgame.GameObject.drawSprite(GameObject.java:141)
at Units.Unit.render(Unit.java:136)
at pkg2dgame.Handler.render(Handler.java:39)
at pkg2dgame.Game.render(Game.java:130)
at pkg2dgame.Game.run(Game.java:156)
at java.lang.Thread.run(Thread.java:745)
javax.imageio.IIOException: Can't read input file!
at javax.imageio.ImageIO.read(ImageIO.java:1301)
at pkg2dgame.GameObject.createSprite(GameObject.java:95)
at pkg2dgame.GameObject.drawSprite(GameObject.java:141)
at Units.Unit.render(Unit.java:136)
at pkg2dgame.Handler.render(Handler.java:39)
at pkg2dgame.Game.render(Game.java:130)
at pkg2dgame.Game.run(Game.java:156)
at java.lang.Thread.run(Thread.java:745)
Exception in thread "Thread-0" java.lang.NullPointerException
at pkg2dgame.GameObject.drawSprite(GameObject.java:141)
at Units.Unit.render(Unit.java:136)
at pkg2dgame.Handler.render(Handler.java:39)
at pkg2dgame.Game.render(Game.java:130)
at pkg2dgame.Game.run(Game.java:156)
at java.lang.Thread.run(Thread.java:745)
false 0 1
java.lang.ArrayIndexOutOfBoundsException: -6
at Pathfinding.Grid.getRange(Grid.java:138)
at pkg2dgame.KeyInput.selectRange(KeyInput.java:349)
at pkg2dgame.KeyInput.mouseReleased(KeyInput.java:240)
at java.awt.Component.processMouseEvent(Component.java:6533)
at java.awt.Component.processEvent(Component.java:6298)
at java.awt.Component.dispatchEventImpl(Component.java:4889)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.awt.EventQueue$4.run(EventQueue.java:729)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
false 0 1
[null]
Dec 4, 2016 4:41 PM
#3

Offline
May 2014
1740
@Cnon
Thanks! ill get on the screen thing and romove the boxes.
appriciate you giving the output btw <3


it appears it wasnt able to find the assets folder. did you run the game in the same location that folder was in?
Dec 4, 2016 5:04 PM
#4

Offline
Oct 2014
3645
yep assets on the same folder
Dec 4, 2016 5:37 PM
#5

Offline
May 2014
1740
@Cnon
hmm that might have been the same error my friend was getting.

http://s000.tinyupload.com/?file_id=61167777921144358448
here is the updated one. when you launch it, you should get a popup that says where its looking for the assets at. can you tell me if what it says is correct?

so thankful for the help <3
Dec 4, 2016 5:52 PM
#6

Offline
Oct 2014
3645
here's how it looks on my end

and here's the output
javax.imageio.IIOException: Can't read input file!
at javax.imageio.ImageIO.read(ImageIO.java:1301)
at Terrain.TerrainType.setSprites(TerrainType.java:81)
at Terrain.Map.setUp(Map.java:98)
at Terrain.Map.<init>(Map.java:67)
at pkg2dgame.Game.instantiateMap(Game.java:221)
at pkg2dgame.Game.<init>(Game.java:64)
at pkg2dgame.Main.main(Main.java:30)
nodes 3066001
javax.imageio.IIOException: Can't read input file!
at javax.imageio.ImageIO.read(ImageIO.java:1301)
at pkg2dgame.GameObject.createSprite(GameObject.java:95)
at pkg2dgame.GameObject.drawSprite(GameObject.java:141)
at Units.Unit.render(Unit.java:136)
at pkg2dgame.Handler.render(Handler.java:39)
at pkg2dgame.Game.render(Game.java:131)
at pkg2dgame.Game.run(Game.java:157)
at java.lang.Thread.run(Thread.java:745)
javax.imageio.IIOException: Can't read input file!
at javax.imageio.ImageIO.read(ImageIO.java:1301)
at pkg2dgame.GameObject.createSprite(GameObject.java:95)
at pkg2dgame.GameObject.drawSprite(GameObject.java:141)
at Units.Unit.render(Unit.java:136)
at pkg2dgame.Handler.render(Handler.java:39)
at pkg2dgame.Game.render(Game.java:131)
at pkg2dgame.Game.run(Game.java:157)
at java.lang.Thread.run(Thread.java:745)
Exception in thread "Thread-0" java.lang.NullPointerException
at pkg2dgame.GameObject.drawSprite(GameObject.java:141)
at Units.Unit.render(Unit.java:136)
at pkg2dgame.Handler.render(Handler.java:39)
at pkg2dgame.Game.render(Game.java:131)
at pkg2dgame.Game.run(Game.java:157)
at java.lang.Thread.run(Thread.java:745)
Game Setup done
false 0 1
[null]
false 1 1
[null]
Dec 4, 2016 6:06 PM
#7

Offline
May 2014
1740
@Cnon
hmm thats so weird. if i delete my assets folder and try to run the game i get this same error. before you got to that screen, right after it says "Launching Game..." there should be a little box that says "Looking in <Your Directory>". did that happen?


btw what operating system is that? ive never seen one like that before o.o
Dec 4, 2016 6:37 PM
#8

Offline
Nov 2011
6330
joey101937 said:
btw what operating system is that? ive never seen one like that before o.o


it's a Gentoo, a flavor of Linux. seems like the person you quoted is using a windows xp theme (makes the desktop look like a windows XP even though it isn't). supposed to be a difficult distro to use though, like Arch.
You can buy lossless digital music from your favorite Japanese artists on https://ototoy.jp/.
The songs are all DRM-free and you can re-download your purchased albums as you wish.
Show your support to your favorite artist if you can!
ps. if you are looking for Japanese albums, you have to search it in Japanese (not romaji). Just copy and paste the name.

For those who want to learn Japanese through anime
Resources for learning the language
Dec 4, 2016 6:50 PM
#9

Offline
May 2014
1740
@DreamingBeats
ah im on win8.1 . maybe the game isnt working because the way it finds its directory is differnet than the way windows does?

ill have to look into it
Dec 4, 2016 9:36 PM

Offline
Oct 2014
3645
it's gentoo and yes I get that 2nd message box
Dec 6, 2016 3:49 PM

Offline
Oct 2014
3645
joey101937 said:
@DreamingBeats
ah im on win8.1 . maybe the game isnt working because the way it finds its directory is differnet than the way windows does?

ill have to look into it

Java is a cross platform language. As long as you have the jvm you can run your program on any os. write once run everywhere
Dec 6, 2016 4:16 PM

Offline
May 2014
1740
Cnon said:
joey101937 said:
@DreamingBeats
ah im on win8.1 . maybe the game isnt working because the way it finds its directory is differnet than the way windows does?

ill have to look into it

Java is a cross platform language. As long as you have the jvm you can run your program on any os. write once run everywhere


technically you are right. that is why you were able to run it in the first place. i think i know what the problem is though. the way this game is set up is that instead of storing the assetsin the jar itself (which i should have done in retrospect), i have commands that have it navagate to a directory (<the jar's location> + "/assets/") and then read the files from said directory. my suspicion is that glentoo has a differnt directory setup than windows and that is preventing it from being able to navigate to the assets folder explaining why it was unable to find the files in your error log.

so far your the only person ive given it to who doesnt run windows and you are also the only one unable to run it. that said the sample size is like 3 or 4 people so always other possibilities
Dec 6, 2016 4:24 PM

Offline
Oct 2014
3645
joey101937 said:
Cnon said:

Java is a cross platform language. As long as you have the jvm you can run your program on any os. write once run everywhere


technically you are right. that is why you were able to run it in the first place. i think i know what the problem is though. the way this game is set up is that instead of storing the assetsin the jar itself (which i should have done in retrospect), i have commands that have it navagate to a directory (<the jar's location> + "/assets/") and then read the files from said directory. my suspicion is that glentoo has a differnt directory setup than windows and that is preventing it from being able to navigate to the assets folder explaining why it was unable to find the files in your error log.

directories are just inodes on linux. windows calls them file ids there's virtually no difference between a windows and linux directory. only difference would be permissions and other metadata because of the filesystem difference.
Dec 6, 2016 4:36 PM

Offline
May 2014
1740
@Cnon
in this one, before the game launches it will show a pop-up window that says the directory its looking for the pictures in. can you tell me what it says and if that is the correct directory it should be looking in?
http://s000.tinyupload.com/?file_id=61167777921144358448

right now all i know is that it cant find the image assets, but i dont know why it cant find them. You are extracting it out of the .zip before running right?
Dec 6, 2016 4:40 PM

Offline
May 2014
1740
Cnon said:
joey101937 said:


technically you are right. that is why you were able to run it in the first place. i think i know what the problem is though. the way this game is set up is that instead of storing the assetsin the jar itself (which i should have done in retrospect), i have commands that have it navagate to a directory (<the jar's location> + "/assets/") and then read the files from said directory. my suspicion is that glentoo has a differnt directory setup than windows and that is preventing it from being able to navigate to the assets folder explaining why it was unable to find the files in your error log.

directories are just inodes on linux. windows calls them file ids there's virtually no difference between a windows and linux directory. only difference would be permissions and other metadata because of the filesystem difference.



sorry for double post but i think i just figured it out
http://www.howtogeek.com/137096/6-ways-the-linux-file-system-is-different-from-the-windows-file-system/

windows uses backslashes for their dirrectories, linux uses forward slashes!
Dec 6, 2016 4:41 PM

Offline
Oct 2014
3645
yes I extract them
and it says looking in /home/sinan/Downloads/Assets\
maybe it's because of the encoding of files
Dec 6, 2016 4:42 PM

Offline
Oct 2014
3645
joey101937 said:
Cnon said:

directories are just inodes on linux. windows calls them file ids there's virtually no difference between a windows and linux directory. only difference would be permissions and other metadata because of the filesystem difference.



sorry for double post but i think i just figured it out
http://www.howtogeek.com/137096/6-ways-the-linux-file-system-is-different-from-the-windows-file-system/

windows uses backslashes for their dirrectories, linux uses forward slashes!

yeah I just noticed that too
Dec 6, 2016 5:15 PM

Offline
May 2014
1740
@Cnon
ok it now automatically checks for linux and should adjust accordingly.
now for the anticlimactic finish of you running my basic game! :D

http://s000.tinyupload.com/?file_id=19777688724742941154
Dec 6, 2016 5:41 PM

Offline
May 2014
1740
derp... i think i may wrote it backwards ._.
youll have to tell me because i cant check since i dont have linux XD

EDIT use this one instead
http://s000.tinyupload.com/?file_id=12913148416442740063
joey101937Dec 6, 2016 6:08 PM
Dec 7, 2016 2:09 AM

Offline
Oct 2014
3645
Didn't work
javax.imageio.IIOException: Can't read input file!
at javax.imageio.ImageIO.read(ImageIO.java:1301)
at Terrain.TerrainType.setSprites(TerrainType.java:84)
at Terrain.Map.setUp(Map.java:98)
at Terrain.Map.<init>(Map.java:67)
at pkg2dgame.Game.instantiateMap(Game.java:220)
at pkg2dgame.Game.<init>(Game.java:63)
at pkg2dgame.Main.main(Main.java:32)
nodes 3066001
Game Setup done
javax.imageio.IIOException: Can't read input file!
at javax.imageio.ImageIO.read(ImageIO.java:1301)
at pkg2dgame.GameObject.createSprite(GameObject.java:95)
at pkg2dgame.GameObject.drawSprite(GameObject.java:141)
at Units.Unit.render(Unit.java:136)
at pkg2dgame.Handler.render(Handler.java:39)
at pkg2dgame.Game.render(Game.java:130)
at pkg2dgame.Game.run(Game.java:156)
at java.lang.Thread.run(Thread.java:745)
javax.imageio.IIOException: Can't read input file!
at javax.imageio.ImageIO.read(ImageIO.java:1301)
at pkg2dgame.GameObject.createSprite(GameObject.java:95)
at pkg2dgame.GameObject.drawSprite(GameObject.java:141)
at Units.Unit.render(Unit.java:136)
at pkg2dgame.Handler.render(Handler.java:39)
at pkg2dgame.Game.render(Game.java:130)
at pkg2dgame.Game.run(Game.java:156)
at java.lang.Thread.run(Thread.java:745)
Exception in thread "Thread-0" java.lang.NullPointerException
at pkg2dgame.GameObject.drawSprite(GameObject.java:141)
at Units.Unit.render(Unit.java:136)
at pkg2dgame.Handler.render(Handler.java:39)
at pkg2dgame.Game.render(Game.java:130)
at pkg2dgame.Game.run(Game.java:156)
at java.lang.Thread.run(Thread.java:745)
false 0 1
java.lang.ArrayIndexOutOfBoundsException: -4
at Pathfinding.Grid.getRange(Grid.java:138)
at pkg2dgame.KeyInput.selectRange(KeyInput.java:349)
at pkg2dgame.KeyInput.mouseReleased(KeyInput.java:240)
at java.awt.Component.processMouseEvent(Component.java:6533)
at java.awt.Component.processEvent(Component.java:6298)
at java.awt.Component.dispatchEventImpl(Component.java:4889)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.awt.EventQueue$4.run(EventQueue.java:729)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Dec 7, 2016 3:05 AM
Lovely person

Offline
Mar 2016
314
Launched Successfully on the first try.



The art for the boat looks a little messed up. And the car died instantly. But considering how I can't even make a single java app working, it's impressive.

Get better and make the game into a masterpiece! Good luck!

Edit: The green on the side is pretty annoying, is that just you not finishing the background, or is that a bug with resizing?
Dec 7, 2016 9:09 AM

Offline
May 2014
1740
@FoxInFlame
thats a bug. green is what is underneith the terrain usually there is some green on the boarders when you move the camera around but its generally not nearly as much as what you showed o.o when you pan the camera around does it not go away?
usually looks like this


@Cnon
dang really? hmm.
try this one
http://s000.tinyupload.com/?file_id=70170530238047311038
this time instead of using slashes im trying File.Separator, which should conform to whatever OS its on
Dec 7, 2016 9:21 AM

Offline
Oct 2014
3645
joey101937 said:
@FoxInFlame
thats a bug. green is what is underneith the terrain usually there is some green on the boarders when you move the camera around but its generally not nearly as much as what you showed o.o when you pan the camera around does it not go away?
usually looks like this


@Cnon
dang really? hmm.
try this one
http://s000.tinyupload.com/?file_id=70170530238047311038
this time instead of using slashes im trying File.Separator, which should conform to whatever OS its on

this one didn't work either it says not using linux. My jre is IcedTea Jre 3.2.0
Not Using Linux
Looking in /home/sinan/Downloads/Assets/
javax.imageio.IIOException: Can't read input file!
at javax.imageio.ImageIO.read(ImageIO.java:1301)
at Terrain.TerrainType.setSprites(TerrainType.java:84)
at Terrain.Map.setUp(Map.java:98)
at Terrain.Map.<init>(Map.java:67)
at pkg2dgame.Game.instantiateMap(Game.java:220)
at pkg2dgame.Game.<init>(Game.java:63)
at pkg2dgame.Main.main(Main.java:34)
nodes 3066001
Game Setup done
javax.imageio.IIOException: Can't read input file!
at javax.imageio.ImageIO.read(ImageIO.java:1301)
at pkg2dgame.GameObject.createSprite(GameObject.java:95)
at pkg2dgame.GameObject.drawSprite(GameObject.java:141)
at Units.Unit.render(Unit.java:136)
at pkg2dgame.Handler.render(Handler.java:39)
at pkg2dgame.Game.render(Game.java:130)
at pkg2dgame.Game.run(Game.java:156)
at java.lang.Thread.run(Thread.java:745)
javax.imageio.IIOException: Can't read input file!
at javax.imageio.ImageIO.read(ImageIO.java:1301)
at pkg2dgame.GameObject.createSprite(GameObject.java:95)
at pkg2dgame.GameObject.drawSprite(GameObject.java:141)
at Units.Unit.render(Unit.java:136)
at pkg2dgame.Handler.render(Handler.java:39)
at pkg2dgame.Game.render(Game.java:130)
at pkg2dgame.Game.run(Game.java:156)
at java.lang.Thread.run(Thread.java:745)
Exception in thread "Thread-0" java.lang.NullPointerException
at pkg2dgame.GameObject.drawSprite(GameObject.java:141)
at Units.Unit.render(Unit.java:136)
at pkg2dgame.Handler.render(Handler.java:39)
at pkg2dgame.Game.render(Game.java:130)
at pkg2dgame.Game.run(Game.java:156)
at java.lang.Thread.run(Thread.java:745)
false 0 1
I'm gonna switch oracle-jre and try again
CnonDec 7, 2016 9:26 AM
Dec 7, 2016 9:31 AM

Offline
May 2014
1740
@Cnon
Hmmmm
I'm in class right now but I'll try again when I get back.

It doesn't know it's on a Linux it seems. May be part of it.
Does that directory look right tho?
Dec 7, 2016 9:52 AM

Offline
Oct 2014
3645
joey101937 said:
@Cnon
Hmmmm
I'm in class right now but I'll try again when I get back.

It doesn't know it's on a Linux it seems. May be part of it.
Does that directory look right tho?

oracle-jre didn't work either
directory looks right it has 52 items and here's the sha1 for it 11888eb8ca726bedae3d7a51e34f984406f967ec
you can compare it to yours
Dec 7, 2016 2:16 PM

Offline
May 2014
1740
@Cnon
http://s000.tinyupload.com/?file_id=11173261205024562477
this time im using purely System.getProperty("user.dir"); this way java should be able to dynamically figure out what the dirrectory is. (before there was still some of my own messings in there)

if it doesnt work this time it might not be a directory related problem
Dec 7, 2016 2:31 PM

Offline
Oct 2014
3645
joey101937 said:
@Cnon
http://s000.tinyupload.com/?file_id=11173261205024562477
this time im using purely System.getProperty("user.dir"); this way java should be able to dynamically figure out what the dirrectory is. (before there was still some of my own messings in there)

if it doesnt work this time it might not be a directory related problem

it detects linux fine but can't load assets again I don't know what the problem is
All I can see is metal and oil pictures. I guess it's not directory related afterall
Looking in /home/sinan/Downloads/Assets/
javax.imageio.IIOException: Can't read input file!
at javax.imageio.ImageIO.read(ImageIO.java:1301)
at Terrain.TerrainType.setSprites(TerrainType.java:84)
at Terrain.Map.setUp(Map.java:98)
at Terrain.Map.<init>(Map.java:67)
at pkg2dgame.Game.instantiateMap(Game.java:221)
at pkg2dgame.Game.<init>(Game.java:63)
at pkg2dgame.Main.main(Main.java:34)
nodes 3066001
Game Setup done
javax.imageio.IIOException: Can't read input file!
at javax.imageio.ImageIO.read(ImageIO.java:1301)
at pkg2dgame.GameObject.createSprite(GameObject.java:95)
at pkg2dgame.GameObject.drawSprite(GameObject.java:141)
at Units.Unit.render(Unit.java:136)
at pkg2dgame.Handler.render(Handler.java:39)
at pkg2dgame.Game.render(Game.java:130)
at pkg2dgame.Game.run(Game.java:156)
at java.lang.Thread.run(Thread.java:745)
javax.imageio.IIOException: Can't read input file!
at javax.imageio.ImageIO.read(ImageIO.java:1301)
at pkg2dgame.GameObject.createSprite(GameObject.java:95)
at pkg2dgame.GameObject.drawSprite(GameObject.java:141)
at Units.Unit.render(Unit.java:136)
at pkg2dgame.Handler.render(Handler.java:39)
at pkg2dgame.Game.render(Game.java:130)
at pkg2dgame.Game.run(Game.java:156)
at java.lang.Thread.run(Thread.java:745)
Exception in thread "Thread-0" java.lang.NullPointerException
at pkg2dgame.GameObject.drawSprite(GameObject.java:141)
at Units.Unit.render(Unit.java:136)
at pkg2dgame.Handler.render(Handler.java:39)
at pkg2dgame.Game.render(Game.java:130)
at pkg2dgame.Game.run(Game.java:156)
at java.lang.Thread.run(Thread.java:745)
Dec 7, 2016 2:53 PM

Offline
May 2014
1740



Yeah that's what I meant by what I should have done but didn't . I'll try to implement that but it will take some time to rewrite some code.
Dec 7, 2016 2:55 PM

Offline
Oct 2014
3645
joey101937 said:



Yeah that's what I meant by what I should have done but didn't . I'll try to implement that but it will take some time to rewrite some code.

No problem. I'll wait
Dec 8, 2016 3:01 AM

Offline
May 2014
1740
@Cnon
welllll i did it... but it hurt performance and somehow i managed to break it. it will only start through the IDE, not with the standalone .jar

So it may be a while for me to figure this out :/
Dec 11, 2016 12:55 AM

Offline
May 2014
1740
@Cnon
try this version
http://www.filedropper.com/2dgame

i wasnt able to get teh class.resource() to work but i think i figured out why the file.separator isnt working. i accidentally added two of them so it was assets//myPic.png instead of assets/myPic.png
Dec 11, 2016 4:06 AM

Offline
Oct 2014
3645
joey101937 said:
@Cnon
try this version
http://www.filedropper.com/2dgame

i wasnt able to get teh class.resource() to work but i think i figured out why the file.separator isnt working. i accidentally added two of them so it was assets//myPic.png instead of assets/myPic.png

Okay it loads more pics now I can see the grass etc
Looking in /home/sinan/Downloads/Assets/
javax.imageio.IIOException: Can't read input file!
at javax.imageio.ImageIO.read(ImageIO.java:1301)
at Terrain.TerrainType.setSprites(TerrainType.java:87)
at Terrain.Map.setUp(Map.java:98)
at Terrain.Map.<init>(Map.java:67)
at pkg2dgame.Game.instantiateMap(Game.java:222)
at pkg2dgame.Game.<init>(Game.java:63)
at pkg2dgame.Main.main(Main.java:31)
nodes 3066001
javax.imageio.IIOException: Can't read input file!
at javax.imageio.ImageIO.read(ImageIO.java:1301)
at pkg2dgame.GameObject.loadSprites(GameObject.java:260)
at Units.GameUnits.BasicBoat.<init>(BasicBoat.java:46)
at pkg2dgame.Game.setStartingUnits(Game.java:210)
at pkg2dgame.Game.<init>(Game.java:78)
at pkg2dgame.Main.main(Main.java:31)
javax.imageio.IIOException: Can't read input file!
at javax.imageio.ImageIO.read(ImageIO.java:1301)
at pkg2dgame.GameObject.loadSprites(GameObject.java:260)
at Units.GameUnits.BasicBoat.<init>(BasicBoat.java:46)
at pkg2dgame.Game.setStartingUnits(Game.java:210)
at pkg2dgame.Game.<init>(Game.java:78)
at pkg2dgame.Main.main(Main.java:31)
javax.imageio.IIOException: Can't read input file!
at javax.imageio.ImageIO.read(ImageIO.java:1301)
at pkg2dgame.GameObject.loadSprites(GameObject.java:260)
at Units.GameUnits.BasicBoat.<init>(BasicBoat.java:46)
at pkg2dgame.Game.setStartingUnits(Game.java:210)
at pkg2dgame.Game.<init>(Game.java:78)
at pkg2dgame.Main.main(Main.java:31)
javax.imageio.IIOException: Can't read input file!
at javax.imageio.ImageIO.read(ImageIO.java:1301)
at pkg2dgame.GameObject.loadSprites(GameObject.java:260)
at Units.GameUnits.BasicBoat.<init>(BasicBoat.java:46)
at pkg2dgame.Game.setStartingUnits(Game.java:210)
at pkg2dgame.Game.<init>(Game.java:78)
at pkg2dgame.Main.main(Main.java:31)
javax.imageio.IIOException: Can't read input file!
at javax.imageio.ImageIO.read(ImageIO.java:1301)
at pkg2dgame.GameObject.loadSprites(GameObject.java:260)
at Units.GameUnits.BasicBoat.<init>(BasicBoat.java:46)
at pkg2dgame.Game.setStartingUnits(Game.java:210)
at pkg2dgame.Game.<init>(Game.java:78)
at pkg2dgame.Main.main(Main.java:31)
javax.imageio.IIOException: Can't read input file!
at javax.imageio.ImageIO.read(ImageIO.java:1301)
at pkg2dgame.GameObject.loadSprites(GameObject.java:260)
at Units.GameUnits.BasicBoat.<init>(BasicBoat.java:46)
at pkg2dgame.Game.setStartingUnits(Game.java:210)
at pkg2dgame.Game.<init>(Game.java:78)
at pkg2dgame.Main.main(Main.java:31)
javax.imageio.IIOException: Can't read input file!
at javax.imageio.ImageIO.read(ImageIO.java:1301)
at pkg2dgame.GameObject.loadSprites(GameObject.java:260)
at Units.GameUnits.BasicBoat.<init>(BasicBoat.java:46)
at pkg2dgame.Game.setStartingUnits(Game.java:210)
at pkg2dgame.Game.<init>(Game.java:78)
at pkg2dgame.Main.main(Main.java:31)
javax.imageio.IIOException: Can't read input file!
at javax.imageio.ImageIO.read(ImageIO.java:1301)
at pkg2dgame.GameObject.loadSprites(GameObject.java:260)
at Units.GameUnits.BasicBoat.<init>(BasicBoat.java:46)
at pkg2dgame.Game.setStartingUnits(Game.java:210)
at pkg2dgame.Game.<init>(Game.java:78)
at pkg2dgame.Main.main(Main.java:31)
javax.imageio.IIOException: Can't read input file!
at javax.imageio.ImageIO.read(ImageIO.java:1301)
at pkg2dgame.GameObject.loadMFSprites(GameObject.java:270)
at Units.GameUnits.BasicBoat.<init>(BasicBoat.java:47)
at pkg2dgame.Game.setStartingUnits(Game.java:210)
at pkg2dgame.Game.<init>(Game.java:78)
at pkg2dgame.Main.main(Main.java:31)
javax.imageio.IIOException: Can't read input file!
at javax.imageio.ImageIO.read(ImageIO.java:1301)
at pkg2dgame.GameObject.loadMFSprites(GameObject.java:270)
at Units.GameUnits.BasicBoat.<init>(BasicBoat.java:47)
at pkg2dgame.Game.setStartingUnits(Game.java:210)
at pkg2dgame.Game.<init>(Game.java:78)
at pkg2dgame.Main.main(Main.java:31)
javax.imageio.IIOException: Can't read input file!
at javax.imageio.ImageIO.read(ImageIO.java:1301)
at pkg2dgame.GameObject.loadMFSprites(GameObject.java:270)
at Units.GameUnits.BasicBoat.<init>(BasicBoat.java:47)
at pkg2dgame.Game.setStartingUnits(Game.java:210)
at pkg2dgame.Game.<init>(Game.java:78)
at pkg2dgame.Main.main(Main.java:31)
javax.imageio.IIOException: Can't read input file!
at javax.imageio.ImageIO.read(ImageIO.java:1301)
at pkg2dgame.GameObject.loadMFSprites(GameObject.java:270)
at Units.GameUnits.BasicBoat.<init>(BasicBoat.java:47)
at pkg2dgame.Game.setStartingUnits(Game.java:210)
at pkg2dgame.Game.<init>(Game.java:78)
at pkg2dgame.Main.main(Main.java:31)
javax.imageio.IIOException: Can't read input file!
at javax.imageio.ImageIO.read(ImageIO.java:1301)
at pkg2dgame.GameObject.loadMFSprites(GameObject.java:270)
at Units.GameUnits.BasicBoat.<init>(BasicBoat.java:47)
at pkg2dgame.Game.setStartingUnits(Game.java:210)
at pkg2dgame.Game.<init>(Game.java:78)
at pkg2dgame.Main.main(Main.java:31)
javax.imageio.IIOException: Can't read input file!
at javax.imageio.ImageIO.read(ImageIO.java:1301)
at pkg2dgame.GameObject.loadMFSprites(GameObject.java:270)
at Units.GameUnits.BasicBoat.<init>(BasicBoat.java:47)
at pkg2dgame.Game.setStartingUnits(Game.java:210)
at pkg2dgame.Game.<init>(Game.java:78)
at pkg2dgame.Main.main(Main.java:31)
javax.imageio.IIOException: Can't read input file!
at javax.imageio.ImageIO.read(ImageIO.java:1301)
at pkg2dgame.GameObject.loadMFSprites(GameObject.java:270)
at Units.GameUnits.BasicBoat.<init>(BasicBoat.java:47)
at pkg2dgame.Game.setStartingUnits(Game.java:210)
at pkg2dgame.Game.<init>(Game.java:78)
at pkg2dgame.Main.main(Main.java:31)
javax.imageio.IIOException: Can't read input file!
at javax.imageio.ImageIO.read(ImageIO.java:1301)
at pkg2dgame.GameObject.loadMFSprites(GameObject.java:270)
at Units.GameUnits.BasicBoat.<init>(BasicBoat.java:47)
at pkg2dgame.Game.setStartingUnits(Game.java:210)
at pkg2dgame.Game.<init>(Game.java:78)
at pkg2dgame.Main.main(Main.java:31)
Exception in thread "Thread-0" java.lang.NullPointerException
at pkg2dgame.GameObject.drawSprite(GameObject.java:133)
at Units.Unit.render(Unit.java:136)
at pkg2dgame.Handler.render(Handler.java:39)
at pkg2dgame.Game.render(Game.java:130)
at pkg2dgame.Game.run(Game.java:156)
at java.lang.Thread.run(Thread.java:745)
Game Setup done
false 0 1
[null]
false 1 1
[null]
false 1 1
[null]
Dec 11, 2016 11:40 AM

Offline
May 2014
1740
So it's loading some sorties but not all?
That's so weird...

More topics from this board

» Help me modify this layout

Luffie00 - 7 hours ago

0 by Luffie00 »»
7 hours ago

» What software(s) and hardware(s) do you use for digital drawings?

DesuMaiden - Apr 16

10 by JKKH »»
10 hours ago

» Share Your YouTube Channel/Videos! ( 1 2 3 4 5 ... Last Page )

nin-tendo - Dec 16, 2022

357 by nin-tendo »»
Yesterday, 12:16 PM

» Protect or punish?

DollzchanAi - Yesterday

2 by Cammell »»
Yesterday, 6:19 AM

» Show us your latest sketch or drawing v.2 ( 1 2 3 4 5 ... Last Page )

Luna - Feb 21, 2017

1628 by JKKH »»
Apr 17, 9:47 PM
It’s time to ditch the text file.
Keep track of your anime easily by creating your own list.
Sign Up Login