Why does my game crash when I start a new Screen ? libgdx library fatal error

0

When my player dies and I create a new Screen it gives me a fatal error code. This is the log of the error from eclipse. Maybe is the dispose method of Screen class that I call when I start new Screen() ?

   A fatal error has been detected by the Java Runtime Environment:
    #
    #  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffa607248f4, pid=14544, tid=0x00000000000032ec
    #
    # JRE version: Java(TM) SE Runtime Environment (8.0_201-b09) (build 1.8.0_201-b09)
    # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.201-b09 mixed mode windows-amd64 compressed oops)
    # Problematic frame:
    # C  [msvcrt.dll+0x748f4]
    #
    # Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
    #
    # If you would like to submit a bug report, please visit:
    #   http://bugreport.java.com/bugreport/crash.jsp
    # The crash happened outside the Java Virtual Machine in native code.
    # See problematic frame for where to report the bug.
    #

    ---------------  T H R E A D  ---------------

    Current thread (0x000000001e61b000):  JavaThread "LWJGL Application" [_thread_in_native, id=13036, stack(0x0000000021af0000,0x0000000021bf0000)]

    siginfo: ExceptionCode=0xc0000005, writing address 0x000000001ffeb000

    Registers:
    RAX=0x000000076c2188c8, RBX=0x000000001e61b1f8, RCX=0x000000001ffeb010, RDX=0x000000074c22e0f8
    RSP=0x0000000021beeab8, RBP=0x0000000021beeb50, RSI=0x0000000000000cc8, RDI=0x0000000000000000
    R8 =0x0000000000000000, R9 =0x0000000000000158, R10=0x000000000000000c, R11=0x000000001ffea7d0
    R12=0x000000076c2188c8, R13=0x000000001ffea7d0, R14=0x0000000021beeb80, R15=0x000000001e61b000
    RIP=0x00007ffa607248f4, EFLAGS=0x0000000000010202

    Top of Stack: (sp=0x0000000021beeab8)
    0x0000000021beeab8:   0000000065ac3a54 000000001e61b1f8
    0x0000000021beeac8:   0000000021beeb50 0000000000000cc8
    0x0000000021beead8:   0000000000000000 0000000021beeb70
    0x0000000021beeae8:   00000007c0027c78 0000000000000000
    0x0000000021beeaf8:   0000000000000000 0000000021beeb90
    0x0000000021beeb08:   0000000000000000 000000076c1fff40
    0x0000000021beeb18:   000000000321c8ee 0000000021bef140
    0x0000000021beeb28:   0000000003272fcc 000000076c2017d8
    0x0000000021beeb38:   000000076c32ce98 0000000000000cc8
    0x0000000021beeb48:   0000000000000000 000000076c2188b8
    0x0000000021beeb58:   000000076c213388 000000076b7e93a8
    0x0000000021beeb68:   0000000000000000 000000076c32ce98
    0x0000000021beeb78:   000000000333ab78 000000076b7e93a8
    0x0000000021beeb88:   0000000000000000 000000076c213388
    0x0000000021beeb98:   000000000333ab78 000000076c1f41a8
    0x0000000021beeba8:   000000076b75cb50 000000076c1f4138 

    Instructions: (pc=0x00007ffa607248f4)
    0x00007ffa607248d4:   00 00 0f 87 76 00 00 00 49 83 e0 1f f3 0f 6f 04
    0x00007ffa607248e4:   11 f3 0f 6f 4c 11 10 48 83 c1 20 66 0f 7f 41 e0
    0x00007ffa607248f4:   66 0f 7f 49 f0 49 ff c9 75 e2 e9 4f ff ff ff 66
    0x00007ffa60724904:   66 66 66 66 66 66 0f 1f 84 00 00 00 00 00 66 66 


    Register to memory mapping:

    RAX=0x000000076c2188c8 is an oop

    [error occurred during error reporting (printing register info), id 0xc0000005]

    Stack: [0x0000000021af0000,0x0000000021bf0000],  sp=0x0000000021beeab8,  free space=1018k
    Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
    C  [msvcrt.dll+0x748f4]
    C  [gdx64.dll+0x3a54]
    C  0x000000000321c8ee

    Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
    J 683  com.badlogic.gdx.utils.BufferUtils.copyJni([FLjava/nio/Buffer;II)V (0 bytes) @ 0x000000000321c870 [0x000000000321c800+0x70]
    J 1095 C2 com.badlogic.gdx.utils.BufferUtils.copy([FLjava/nio/Buffer;II)V (45 bytes) @ 0x000000000333ab78 [0x000000000333ab00+0x78]
    J 1179 C1 com.badlogic.gdx.graphics.glutils.VertexBufferObject.setVertices([FII)V (38 bytes) @ 0x00000000033756fc [0x0000000003375660+0x9c]
    J 1181 C1 com.badlogic.gdx.graphics.glutils.ImmediateModeRenderer20.flush()V (113 bytes) @ 0x0000000003377b1c [0x0000000003376e20+0xcfc]
    J 1168 C1 com.badlogic.gdx.physics.box2d.Box2DDebugRenderer.renderBodies(Lcom/badlogic/gdx/physics/box2d/World;)V (194 bytes) @ 0x000000000336ca94 [0x000000000336ba00+0x1094]
    J 1260 C1 it.unibo.oop.supermario.screens.PlayScreen.render(F)V (159 bytes) @ 0x00000000033c015c [0x00000000033bf460+0xcfc]
    J 1205 C1 it.unibo.oop.supermario.game.SuperMario.render()V (5 bytes) @ 0x000000000339bac4 [0x000000000339b8e0+0x1e4]
    j  com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop()V+698
    j  com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run()V+27
    v  ~StubRoutines::call_stub

    ---------------  P R O C E S S  ---------------

    Java Threads: ( => current thread )
      0x000000002eede000 JavaThread "LWJGL Timer" daemon [_thread_blocked, id=10548, stack(0x000000002ff80000,0x0000000030080000)]
      0x0000000021ed6000 JavaThread "AssetManager" daemon [_thread_blocked, id=13944, stack(0x000000002ecb0000,0x000000002edb0000)]
      0x0000000002c5e000 JavaThread "DestroyJavaVM" [_thread_blocked, id=13184, stack(0x0000000002d40000,0x0000000002e40000)]
    =>0x000000001e61b000 JavaThread "LWJGL Application" [_thread_in_native, id=13036, stack(0x0000000021af0000,0x0000000021bf0000)]
      0x000000001e372000 JavaThread "Service Thread" daemon [_thread_blocked, id=17680, stack(0x000000001fd70000,0x000000001fe70000)]
      0x000000001e2e7000 JavaThread "C1 CompilerThread3" daemon [_thread_blocked, id=18204, stack(0x000000001fc70000,0x000000001fd70000)]
      0x000000001e2e6800 JavaThread "C2 CompilerThread2" daemon [_thread_blocked, id=16052, stack(0x000000001fb70000,0x000000001fc70000)]
      0x000000001e2d7000 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=10772, stack(0x000000001fa70000,0x000000001fb70000)]
      0x000000001e2d2000 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=3476, stack(0x000000001f970000,0x000000001fa70000)]
      0x000000001e2cb000 JavaThread "Attach Listener" daemon [_thread_blocked, id=18196, stack(0x000000001f870000,0x000000001f970000)]
      0x000000001cc0e000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=13672, stack(0x000000001f770000,0x000000001f870000)]
      0x000000001e2c3000 JavaThread "Finalizer" daemon [_thread_blocked, id=7472, stack(0x000000001f550000,0x000000001f650000)]
      0x0000000002f3a000 JavaThread "Reference Handler" daemon [_thread_blocked, id=18008, stack(0x000000001f450000,0x000000001f550000)]

    Other Threads:
      0x000000001e2a2800 VMThread [stack: 0x000000001f350000,0x000000001f450000] [id=100]
      0x000000001e38d000 WatcherThread [stack: 0x000000001fe70000,0x000000001ff70000] [id=13084]

    VM state:not at safepoint (normal execution)

    VM Mutex/Monitor currently owned by a thread: None

    heap address: 0x00000006c0a00000, size: 4086 MB, Compressed Oops mode: Zero based, Oop shift amount: 3
    Narrow klass base: 0x0000000000000000, Narrow klass shift: 3
    Compressed class space size: 1073741824 Address: 0x00000007c0000000

    Heap:
     PSYoungGen      total 76288K, used 23622K [0x000000076ae00000, 0x0000000770300000, 0x00000007c0000000)
      eden space 65536K, 36% used [0x000000076ae00000,0x000000076c511948,0x000000076ee00000)
      from space 10752K, 0% used [0x000000076f880000,0x000000076f880000,0x0000000770300000)
      to   space 10752K, 0% used [0x000000076ee00000,0x000000076ee00000,0x000000076f880000)
     ParOldGen       total 175104K, used 0K [0x00000006c0a00000, 0x00000006cb500000, 0x000000076ae00000)
      object space 175104K, 0% used [0x00000006c0a00000,0x00000006c0a00000,0x00000006cb500000)
     Metaspace       used 9048K, capacity 9207K, committed 9344K, reserved 1058816K
      class space    used 850K, capacity 884K, committed 896K, reserved 1048576K

    Card table byte_map: [0x0000000012300000,0x0000000012b00000] byte_map_base: 0x000000000ecfb000

    Marking Bits: (ParMarkBitMap*) 0x0000000063924ce0
     Begin Bits: [0x0000000013a60000, 0x0000000017a38000)
     End Bits:   [0x0000000017a38000, 0x000000001ba10000)

    Polling page: 0x0000000001360000

    CodeCache: size=245760Kb used=4842Kb max_used=4854Kb free=240917Kb
     bounds [0x0000000002f40000, 0x0000000003410000, 0x0000000011f40000]
     total_blobs=1824 nmethods=1320 adapters=418
     compilation: enabled

    Compilation events (10 events):
    Event: 14.476 Thread 0x000000001e2e7000 nmethod 1317 0x00000000033f76d0 code [0x00000000033f79a0, 0x00000000033f93c8]
    Event: 14.476 Thread 0x000000001e2e7000 1319       3       com.badlogic.gdx.backends.lwjgl.LwjglGL20::glBindTexture (6 bytes)
    Event: 14.477 Thread 0x000000001e2e7000 nmethod 1319 0x00000000033f9ed0 code [0x00000000033fa0c0, 0x00000000033fa898]
    Event: 14.477 Thread 0x000000001e2e7000 1320       3       org.lwjgl.opengl.GL11::glBindTexture (20 bytes)
    Event: 14.478 Thread 0x000000001e2e7000 nmethod 1320 0x00000000033fae10 code [0x00000000033fb000, 0x00000000033fb758]
    Event: 14.478 Thread 0x000000001e2e7000 1318       3       com.badlogic.gdx.graphics.GLTexture::bind (17 bytes)
    Event: 14.479 Thread 0x000000001e2e7000 nmethod 1318 0x00000000033fbb90 code [0x00000000033fbd80, 0x00000000033fc5f8]
    Event: 14.479 Thread 0x000000001e2e7000 1314       3       java.io.InputStreamReader::read (11 bytes)
    Event: 14.479 Thread 0x000000001e2e7000 nmethod 1314 0x00000000033f4ad0 code [0x00000000033f4c40, 0x00000000033f4de8]
    Event: 14.479 Thread 0x000000001e2e7000 1315   !   3       sun.nio.cs.StreamDecoder::read (196 bytes)

    GC Heap History (0 events):
    No events

    Deoptimization events (10 events):
    Event: 1.337 Thread 0x000000001e61b000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x000000000314c568 method=java.lang.String.<init>([CII)V @ 18
    Event: 1.391 Thread 0x000000001e61b000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000003175e94 method=java.util.StringTokenizer.scanToken(I)I @ 7
    Event: 1.391 Thread 0x000000001e61b000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000003172f90 method=java.util.StringTokenizer.skipDelimiters(I)I @ 29
    Event: 1.401 Thread 0x000000001e61b000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00000000031ae068 method=java.util.StringTokenizer.scanToken(I)I @ 7
    Event: 1.440 Thread 0x000000001e61b000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00000000031d6708 method=java.io.BufferedInputStream.read([BII)I @ 82
    Event: 1.442 Thread 0x000000001e61b000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00000000031da884 method=java.io.BufferedInputStream.read([BII)I @ 82
    Event: 1.448 Thread 0x000000001e61b000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00000000031d3500 method=java.io.BufferedInputStream.read1([BII)I @ 68
    Event: 14.476 Thread 0x000000001e61b000 Uncommon trap: reason=array_check action=maybe_recompile pc=0x000000000330f914 method=com.badlogic.gdx.utils.Array.add(Ljava/lang/Object;)V @ 46
    Event: 14.476 Thread 0x000000001e61b000 Uncommon trap: reason=array_check action=maybe_recompile pc=0x000000000330f914 method=com.badlogic.gdx.utils.Array.add(Ljava/lang/Object;)V @ 46
    Event: 14.476 Thread 0x000000001e61b000 Uncommon trap: reason=array_check action=maybe_recompile pc=0x000000000330f914 method=com.badlogic.gdx.utils.Array.add(Ljava/lang/Object;)V @ 46

    Classes redefined (0 events):
    No events

    Internal exceptions (10 events):
    Event: 0.099 Thread 0x0000000002c5e000 Exception <a 'java/security/PrivilegedActionException'> (0x000000076b0d73d8) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u201\12322\hotspot\src\share\vm\prims\jvm.cpp, line 1502]
    Event: 0.099 Thread 0x0000000002c5e000 Exception <a 'java/security/PrivilegedActionException'> (0x000000076b0d75e8) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u201\12322\hotspot\src\share\vm\prims\jvm.cpp, line 1502]
    Event: 0.100 Thread 0x0000000002c5e000 Exception <a 'java/security/PrivilegedActionException'> (0x000000076b0db258) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u201\12322\hotspot\src\share\vm\prims\jvm.cpp, line 1502]
    Event: 0.100 Thread 0x0000000002c5e000 Exception <a 'java/security/PrivilegedActionException'> (0x000000076b0db468) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u201\12322\hotspot\src\share\vm\prims\jvm.cpp, line 1502]
    Event: 0.227 Thread 0x0000000002c5e000 Exception <a 'java/security/PrivilegedActionException'> (0x000000076b1d6b20) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u201\12322\hotspot\src\share\vm\prims\jvm.cpp, line 1502]
    Event: 0.228 Thread 0x0000000002c5e000 Exception <a 'java/security/PrivilegedActionException'> (0x000000076b1d8890) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u201\12322\hotspot\src\share\vm\prims\jvm.cpp, line 1502]
    Event: 0.228 Thread 0x0000000002c5e000 Exception <a 'java/security/PrivilegedActionException'> (0x000000076b1d9a00) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u201\12322\hotspot\src\share\vm\prims\jvm.cpp, line 1502]
    Event: 0.228 Thread 0x0000000002c5e000 Exception <a 'java/security/PrivilegedActionException'> (0x000000076b1deb68) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u201\12322\hotspot\src\share\vm\prims\jvm.cpp, line 1502]
    Event: 0.228 Thread 0x0000000002c5e000 Exception <a 'java/security/PrivilegedActionException'> (0x000000076b1df7c0) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u201\12322\hotspot\src\share\vm\prims\jvm.cpp, line 1502]
    Event: 0.228 Thread 0x0000000002c5e000 Exception <a 'java/security/PrivilegedActionException'> (0x000000076b1e03e8) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u201\12322\hotspot\src\share\vm\prims\jvm.cpp, line 1502]

    Events (10 events):
    Event: 14.476 Thread 0x000000001e61b000 DEOPT PACKING pc=0x000000000330f914 sp=0x0000000021beec10
    Event: 14.476 Thread 0x000000001e61b000 DEOPT UNPACKING pc=0x0000000002f8583b sp=0x0000000021beeba0 mode 2
    Event: 14.476 Thread 0x000000001e61b000 Uncommon trap: trap_request=0xffffffd6 fr.pc=0x000000000330f914
    Event: 14.476 Thread 0x000000001e61b000 DEOPT PACKING pc=0x000000000330f914 sp=0x0000000021beec10
    Event: 14.476 Thread 0x000000001e61b000 DEOPT UNPACKING pc=0x0000000002f8583b sp=0x0000000021beeba0 mode 2
    Event: 14.476 Thread 0x000000001e61b000 Uncommon trap: trap_request=0xffffffd6 fr.pc=0x000000000330f914
    Event: 14.476 Thread 0x000000001e61b000 DEOPT PACKING pc=0x000000000330f914 sp=0x0000000021beec50
    Event: 14.476 Thread 0x000000001e61b000 DEOPT UNPACKING pc=0x0000000002f8583b sp=0x0000000021beebe0 mode 2
    Event: 14.477 loading class com/badlogic/gdx/scenes/scene2d/InputEvent$Type
    Event: 14.477 loading class com/badlogic/gdx/scenes/scene2d/InputEvent$Type done


    Dynamic libraries:
    0x00007ff7b8500000 - 0x00007ff7b8537000     C:\Program Files\Java\jre1.8.0_201\bin\javaw.exe
    0x00007ffa625f0000 - 0x00007ffa627dd000     C:\WINDOWS\SYSTEM32\ntdll.dll
    0x00007ffa62490000 - 0x00007ffa62543000     C:\WINDOWS\System32\KERNEL32.DLL
    0x00007ffa5f030000 - 0x00007ffa5f2c3000     C:\WINDOWS\System32\KERNELBASE.dll
    0x00007ffa621e0000 - 0x00007ffa62283000     C:\WINDOWS\System32\ADVAPI32.dll
    0x00007ffa606b0000 - 0x00007ffa6074e000     C:\WINDOWS\System32\msvcrt.dll
    0x00007ffa623c0000 - 0x00007ffa6245e000     C:\WINDOWS\System32\sechost.dll
    0x00007ffa5fde0000 - 0x00007ffa5ff02000     C:\WINDOWS\System32\RPCRT4.dll
    0x00007ffa5fbd0000 - 0x00007ffa5fd67000     C:\WINDOWS\System32\USER32.dll
    0x00007ffa5f560000 - 0x00007ffa5f580000     C:\WINDOWS\System32\win32u.dll
    0x00007ffa62460000 - 0x00007ffa62489000     C:\WINDOWS\System32\GDI32.dll
    0x00007ffa5e740000 - 0x00007ffa5e8da000     C:\WINDOWS\System32\gdi32full.dll
    0x00007ffa5f780000 - 0x00007ffa5f820000     C:\WINDOWS\System32\msvcp_win.dll
    0x00007ffa5f2d0000 - 0x00007ffa5f3ca000     C:\WINDOWS\System32\ucrtbase.dll
    0x00007ffa535d0000 - 0x00007ffa53849000     C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.17763.379_none_05b83be8071c94a1\COMCTL32.dll
    0x00007ffa607b0000 - 0x00007ffa60add000     C:\WINDOWS\System32\combase.dll
    0x00007ffa5e6c0000 - 0x00007ffa5e73e000     C:\WINDOWS\System32\bcryptPrimitives.dll
    0x00007ffa5fa00000 - 0x00007ffa5fa2e000     C:\WINDOWS\System32\IMM32.DLL
    0x0000000062f20000 - 0x0000000062ff1000     C:\Program Files\Java\jre1.8.0_201\bin\msvcr100.dll
    0x0000000063100000 - 0x00000000639a4000     C:\Program Files\Java\jre1.8.0_201\bin\server\jvm.dll
    0x00007ffa5fa90000 - 0x00007ffa5fa98000     C:\WINDOWS\System32\PSAPI.DLL
    0x00007ffa59e00000 - 0x00007ffa59e09000     C:\WINDOWS\SYSTEM32\WSOCK32.dll
    0x00007ffa5c6c0000 - 0x00007ffa5c6e4000     C:\WINDOWS\SYSTEM32\WINMM.dll
    0x00007ffa59eb0000 - 0x00007ffa59eba000     C:\WINDOWS\SYSTEM32\VERSION.dll
    0x00007ffa62550000 - 0x00007ffa625bd000     C:\WINDOWS\System32\WS2_32.dll
    0x00007ffa5c5a0000 - 0x00007ffa5c5cd000     C:\WINDOWS\SYSTEM32\WINMMBASE.dll
    0x00007ffa5f3d0000 - 0x00007ffa5f41a000     C:\WINDOWS\System32\cfgmgr32.dll
    0x00007ffa55a40000 - 0x00007ffa55a4f000     C:\Program Files\Java\jre1.8.0_201\bin\verify.dll
    0x00007ffa43a40000 - 0x00007ffa43a69000     C:\Program Files\Java\jre1.8.0_201\bin\java.dll
    0x00007ffa48340000 - 0x00007ffa48356000     C:\Program Files\Java\jre1.8.0_201\bin\zip.dll
    0x00007ffa60cf0000 - 0x00007ffa621e0000     C:\WINDOWS\System32\SHELL32.dll
    0x00007ffa60c40000 - 0x00007ffa60ce8000     C:\WINDOWS\System32\shcore.dll
    0x00007ffa5e8e0000 - 0x00007ffa5f02a000     C:\WINDOWS\System32\windows.storage.dll
    0x00007ffa5e690000 - 0x00007ffa5e6b4000     C:\WINDOWS\System32\profapi.dll
    0x00007ffa5e610000 - 0x00007ffa5e66d000     C:\WINDOWS\System32\powrprof.dll
    0x00007ffa60750000 - 0x00007ffa607a2000     C:\WINDOWS\System32\shlwapi.dll
    0x00007ffa5e670000 - 0x00007ffa5e681000     C:\WINDOWS\System32\kernel.appcore.dll
    0x00007ffa5f760000 - 0x00007ffa5f777000     C:\WINDOWS\System32\cryptsp.dll
    0x0000000065ac0000 - 0x0000000065b0b000     C:\Users\Simone\AppData\Local\Temp\libgdxSimone\103cb0d6\gdx64.dll
    0x00007ffa5da30000 - 0x00007ffa5da63000     C:\WINDOWS\system32\rsaenh.dll
    0x00007ffa5f4d0000 - 0x00007ffa5f4f6000     C:\WINDOWS\System32\bcrypt.dll
    0x00007ffa5e4f0000 - 0x00007ffa5e518000     C:\WINDOWS\SYSTEM32\USERENV.dll
    0x00007ffa5e040000 - 0x00007ffa5e04c000     C:\WINDOWS\SYSTEM32\CRYPTBASE.dll
    0x00007ffa45430000 - 0x00007ffa4544a000     C:\Program Files\Java\jre1.8.0_201\bin\net.dll
    0x00007ffa55050000 - 0x00007ffa55226000     C:\WINDOWS\SYSTEM32\urlmon.dll
    0x00007ffa53900000 - 0x00007ffa53ba8000     C:\WINDOWS\SYSTEM32\iertutil.dll
    0x00007ffa5de70000 - 0x00007ffa5ded7000     C:\WINDOWS\system32\mswsock.dll
    0x00007ffa5dbd0000 - 0x00007ffa5dc0d000     C:\WINDOWS\SYSTEM32\IPHLPAPI.DLL
    0x00007ffa5fdd0000 - 0x00007ffa5fdd8000     C:\WINDOWS\System32\NSI.dll
    0x00007ffa58b20000 - 0x00007ffa58b36000     C:\WINDOWS\SYSTEM32\dhcpcsvc6.DLL
    0x00007ffa58ae0000 - 0x00007ffa58afc000     C:\WINDOWS\SYSTEM32\dhcpcsvc.DLL
    0x00007ffa5dc10000 - 0x00007ffa5dcd6000     C:\WINDOWS\SYSTEM32\DNSAPI.dll
    0x00007ffa453c0000 - 0x00007ffa453d1000     C:\Program Files\Java\jre1.8.0_201\bin\nio.dll
    0x0000000180000000 - 0x0000000180053000     C:\Users\Simone\AppData\Local\Temp\libgdxSimone\dc0f0009\lwjgl64.dll
    0x00007ffa33300000 - 0x00007ffa33427000     C:\WINDOWS\SYSTEM32\OPENGL32.dll
    0x00007ffa53c70000 - 0x00007ffa53c9c000     C:\WINDOWS\SYSTEM32\GLU32.dll
    0x00007ffa3c6c0000 - 0x00007ffa3c7b0000     C:\Users\Simone\AppData\Local\Temp\libgdxSimone\dc0f0009\OpenAL64.dll
    0x00007ffa60ae0000 - 0x00007ffa60c35000     C:\WINDOWS\System32\ole32.dll
    0x00007ffa5cc10000 - 0x00007ffa5ccac000     C:\WINDOWS\system32\uxtheme.dll
    0x00007ffa39720000 - 0x00007ffa39759000     C:\Program Files\Nahimic\Nahimic2\UserInterface\x64\Nahimic2DevProps.dll
    0x00007ffa443b0000 - 0x00007ffa443fd000     C:\Program Files\Nahimic\Nahimic2\UserInterface\x64\Nahimic2OSD.dll
    0x00007ffa5f820000 - 0x00007ffa5f8c2000     C:\WINDOWS\System32\clbcatq.dll
    0x00000000206e0000 - 0x0000000020936000     C:\Program Files (x86)\RivaTuner Statistics Server\RTSSHooks64.dll
    0x00007ffa55b20000 - 0x00007ffa55b90000     C:\WINDOWS\System32\MMDevApi.dll
    0x00007ffa5e400000 - 0x00007ffa5e429000     C:\WINDOWS\System32\DEVOBJ.dll
    0x00007ffa5b030000 - 0x00007ffa5b1d8000     C:\WINDOWS\System32\PROPSYS.dll
    0x00007ffa62290000 - 0x00007ffa6235b000     C:\WINDOWS\System32\OLEAUT32.dll
    0x00007ffa55230000 - 0x00007ffa55378000     C:\WINDOWS\SYSTEM32\AUDIOSES.DLL
    0x00007ffa5a3a0000 - 0x00007ffa5a4f3000     C:\WINDOWS\SYSTEM32\wintypes.dll
    0x00007ffa5ad90000 - 0x00007ffa5ad9a000     C:\WINDOWS\SYSTEM32\AVRT.dll
    0x00007ffa5cf70000 - 0x00007ffa5cf84000     C:\WINDOWS\SYSTEM32\resourcepolicyclient.dll
    0x00007ffa60540000 - 0x00007ffa606aa000     C:\WINDOWS\System32\MSCTF.dll
    0x00007ffa5cd00000 - 0x00007ffa5cd2e000     C:\WINDOWS\system32\dwmapi.dll
    0x00007ffa5f580000 - 0x00007ffa5f75b000     C:\WINDOWS\System32\CRYPT32.dll
    0x00007ffa5e5f0000 - 0x00007ffa5e602000     C:\WINDOWS\System32\MSASN1.dll
    0x00007ffa4b430000 - 0x00007ffa4b4c5000     C:\WINDOWS\System32\TextInputFramework.dll
    0x00007ffa5a5e0000 - 0x00007ffa5a902000     C:\WINDOWS\System32\CoreUIComponents.dll
    0x00007ffa5c5d0000 - 0x00007ffa5c6b2000     C:\WINDOWS\System32\CoreMessaging.dll
    0x00007ffa5d7c0000 - 0x00007ffa5d7f1000     C:\WINDOWS\SYSTEM32\ntmarta.dll
    0x0000000060860000 - 0x0000000062f20000     C:\WINDOWS\System32\DriverStore\FileRepository\nvgbdi.inf_amd64_1c852f2bd83e0ff9\nvoglv64.dll
    0x00007ffa5ff10000 - 0x00007ffa60385000     C:\WINDOWS\System32\SETUPAPI.dll
    0x00007ffa5b210000 - 0x00007ffa5b223000     C:\WINDOWS\SYSTEM32\WTSAPI32.dll
    0x00007ffa5f500000 - 0x00007ffa5f559000     C:\WINDOWS\System32\WINTRUST.dll
    0x00007ffa2a540000 - 0x00007ffa2a7e7000     C:\WINDOWS\system32\nvspcap64.dll
    0x00007ffa4e3a0000 - 0x00007ffa4e58d000     C:\WINDOWS\SYSTEM32\dbghelp.dll
    0x00007ffa4e370000 - 0x00007ffa4e39a000     C:\WINDOWS\SYSTEM32\dbgcore.DLL
    0x00007ffa4ef50000 - 0x00007ffa4effd000     C:\WINDOWS\SYSTEM32\mscms.dll
    0x00007ffa5c860000 - 0x00007ffa5c870000     C:\WINDOWS\SYSTEM32\ColorAdapterClient.dll
    0x00007ffa423d0000 - 0x00007ffa42413000     C:\WINDOWS\SYSTEM32\icm32.dll
    0x00007ffa5d710000 - 0x00007ffa5d768000     C:\WINDOWS\SYSTEM32\WINSTA.dll
    0x000000006e9c0000 - 0x000000006ea1b000     C:\Users\Simone\AppData\Local\Temp\libgdxSimone\f1815c51\gdx-box2d64.dll

    VM Arguments:
    jvm_args: -Dfile.encoding=UTF-8 
    java_command: it.unibo.oop.supermario.main.LaunchGame
    java_class_path (initial): C:\Users\Simone\git\oop18-supermario\bin;C:\Users\Simone\git\oop18-supermario\libs\gdx.jar;C:\Users\Simone\git\oop18-supermario\libs\gdx-box2d.jar;C:\Users\Simone\git\oop18-supermario\libs\gdx-backend-lwjgl-natives.jar;C:\Users\Simone\git\oop18-supermario\libs\gdx-backend-lwjgl.jar;C:\Users\Simone\git\oop18-supermario\libs\gdx-box2d-natives.jar;C:\Users\Simone\git\oop18-supermario\libs\gdx-natives.jar
    Launcher Type: SUN_STANDARD

package it.unibo.oop.supermario.screens;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
import com.badlogic.gdx.maps.MapObject;
import com.badlogic.gdx.maps.objects.RectangleMapObject;
import com.badlogic.gdx.maps.tiled.TiledMap;
import com.badlogic.gdx.maps.tiled.TiledMapTileLayer;
import com.badlogic.gdx.maps.tiled.TmxMapLoader;
import com.badlogic.gdx.maps.tiled.renderers.OrthogonalTiledMapRenderer;
import com.badlogic.gdx.math.Rectangle;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.physics.box2d.Box2DDebugRenderer;
import com.badlogic.gdx.physics.box2d.World;
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.viewport.FitViewport;
import com.badlogic.gdx.utils.viewport.Viewport;

import it.unibo.oop.supermario.controller.MarioControllerImpl;
import it.unibo.oop.supermario.game.SuperMario;
import it.unibo.oop.supermario.gamemanager.CollisionFinder;
import it.unibo.oop.supermario.graphics.MarioView;
import it.unibo.oop.supermario.model.BlockImpl;
import it.unibo.oop.supermario.model.Goomba;
import it.unibo.oop.supermario.model.Koopa;
import it.unibo.oop.supermario.model.MarioImpl;

public class PlayScreen  implements Screen {
    private SuperMario game;    
    private OrthographicCamera gamecam;
    private Viewport gamePort;
    private TmxMapLoader ml;
    private TiledMap map;
    private OrthogonalTiledMapRenderer mapRenderer;
    private BlockImpl mapBlocks;
    private Hud hud;

    private Array<Goomba> goombas;
    private Array<Koopa> koopas;

    private World world;
    private Box2DDebugRenderer b2dr;
    private boolean enableDebug;
    private MarioControllerImpl marioController;
    private float mapWidth; 

    public PlayScreen(SuperMario marioBros) {       
        this.game = marioBros;  
        gamecam = new OrthographicCamera();
        gamePort = new FitViewport(SuperMario.V_WIDTH / SuperMario.PPM, SuperMario.V_HEIGHT / SuperMario.PPM, gamecam);
        hud = new Hud(game.batch);
        ml=new TmxMapLoader();
        map=ml.load("level1.tmx");
        mapRenderer=new OrthogonalTiledMapRenderer(map, 1/SuperMario.PPM);
        mapWidth = ((TiledMapTileLayer)map.getLayers().get(0)).getWidth();
        gamecam.position.set(SuperMario.V_WIDTH/2/ SuperMario.PPM, SuperMario.V_HEIGHT/2/ SuperMario.PPM, 0);
        world = new World(new Vector2(0,-10),true);
        b2dr = new Box2DDebugRenderer();        
        getEnemies();
        marioController = new MarioControllerImpl(new MarioImpl(this,32/ SuperMario.PPM,32/ SuperMario.PPM),new MarioView());
        world.setContactListener(new CollisionFinder());
        enableDebug = false;    
        mapBlocks=new BlockImpl(world, map);
    }

    private void getEnemies() {
        //create all goombas
          goombas = new Array<Goomba>();
        for(MapObject object : map.getLayers().get(6).getObjects().getByType(RectangleMapObject.class)){
            Rectangle rect = ((RectangleMapObject) object).getRectangle();
            goombas.add(new Goomba(this, rect.getX() / SuperMario.PPM, rect.getY() / SuperMario.PPM));
        }
        koopas = new Array<Koopa>();
        for(MapObject object : map.getLayers().get(7).getObjects().getByType(RectangleMapObject.class)){
            Rectangle rect = ((RectangleMapObject) object).getRectangle();
            koopas.add(new Koopa(this, rect.getX() / SuperMario.PPM, rect.getY() / SuperMario.PPM));
        }   

    }

    public void create() {

    }

    public TextureAtlas getAtlas() {
        return null;
    }

    public float getMapWidth() {
        return mapWidth;
    }

    @Override
    public void show() {

    }

    public void update(float dt) {  
        world.step(1/60f, 6, 2);
        hud.update(dt);

        if(Gdx.input.isKeyJustPressed(Input.Keys.B))
            enableDebug = !enableDebug; 

        marioController.update(dt); 
        for (Goomba goomba : goombas) {
            goomba.update(dt);  
        }
        for (Koopa koopa : koopas) {
            koopa.update(dt);   
        }

        if(marioController.getBody().getPosition().x>=SuperMario.V_WIDTH/2/SuperMario.PPM)
            gamecam.position.x = marioController.getBody().getPosition().x;
        if(marioController.isDead()) {
            gameOver();
        }

        gamecam.update();
        mapRenderer.setView(gamecam);
    }


    @Override
    public void render(float delta) {
        update(delta);

        //clear screen

        Gdx.gl.glClearColor(0, 0, 0, 1);
        Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);


        mapRenderer.render();
        if(enableDebug) {
            b2dr.render(world, gamecam.combined);
        }
        game.batch.setProjectionMatrix(hud.stage.getCamera().combined);
        hud.stage.draw();
        game.batch.setProjectionMatrix(gamecam.combined);
        game.batch.begin();
        //draw mario on the screen
        marioController.render(game.batch);

        //enemies
        for (Goomba goomba : goombas) {
            goomba.draw(game.batch);
        }
        for (Koopa koopa : koopas) {
            koopa.draw(game.batch); 
        }   
        game.batch.end();
    }

    @Override
    public void resize(int width, int height) {
        gamePort.update(width, height);
    }

    @Override
    public void pause() {
        // TODO Auto-generated method stub

    }

    @Override
    public void resume() {
        // TODO Auto-generated method stub

    }


    @Override
    public void hide() {
        // TODO Auto-generated method stub

    }

    @Override
    public void dispose() {     
        map.dispose();  
        // dispose of mapRenderer cause fatal error 
        mapRenderer.dispose();
        b2dr.dispose();
        hud.dispose();
        //marioController.dispose();
    }

    public World getWorld() {
        return world;
    }

    public void gameOver() {
        game.setScreen(new GameOverScreen(game));
        dispose();  
    }

}

java
libgdx
asked on Stack Overflow Apr 2, 2019 by Fonta • edited Apr 3, 2019 by Fonta

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0