# \[Very tiny little micro game\] 🐍 What do you think about this?

**URL:** https://discourse.processing.org/t/very-tiny-little-micro-game-what-do-you-think-about-this/8697
**Category:** Processing.py
**Created:** [February 24, 2019, 8:00pm UTC](https://discourse.processing.org/t/very-tiny-little-micro-game-what-do-you-think-about-this/8697 "2019-02-24T20:00:13Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Sky](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/sky/32/3013_2.png) [@Sky](https://discourse.processing.org/u/Sky)
#### Post date: [February 24, 2019, 8:00pm UTC](https://discourse.processing.org/t/very-tiny-little-micro-game-what-do-you-think-about-this/8697/1 "2019-02-24T20:00:13Z")

</div>

🐍 🐍 🐍 🐍 🐍 🐍 🐍 🐍 🐍 🐍 🐍 🐍 🐍 🐍 🐍 🐍 🐍 🐍 🐍 🐍 🐍 🐍 🐍 🐍 🐍 🐍  
🐍  
🐍 This project is not completed yet, but sometimes my collision and sound dont work, (I think its not 🐍 my fault in this case, because when I played with just one enemy, everything worked fine),  
🐍and, apart from this, I would like to know what do you think about my project.  
🐍  
🐍 [Heres’s the project](https://drive.google.com/open?id=1hY_Ki9xR3-TibLIFcEqR5_h3rf7S6ytJ)  
🐍  
🐍 (They should add a an _“Emoji Text Format”_ 😉 )  
🐍 🐍 🐍 🐍 🐍 🐍 🐍 🐍 🐍 🐍 🐍 🐍 🐍 🐍 🐍 🐍 🐍 🐍 🐍 🐍 🐍 🐍 🐍 🐍 🐍 🐍

---

<div class="post-metadata">

### Author: ![glitching.world](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glitching.world/32/3844_2.png) [@glitching.world](https://discourse.processing.org/u/glitching.world)
#### Post date: [February 24, 2019, 8:43pm UTC](https://discourse.processing.org/t/very-tiny-little-micro-game-what-do-you-think-about-this/8697/2 "2019-02-24T20:43:47Z")

</div>

Hi! I’m not the best person to help you, but I think the design of the ships is pretty neat 🙂  
But I run into a problem (it happens as soon as the bullet hits the enemy), probably it’s just me missing a library 😅  
Also if the keys used to move are A \ W \ S \ D the fire key should not be F its to close to the others it makes for an awkward hand placement on the keyboard.

P.S.: If you found out how to do diagonal movement with the keys, please let me know 😊

> **Summary**
>
> NullPointerException  
> at processing.sound.AudioSample.rate(Unknown Source)  
> at processing.sound.SoundFile.rate(Unknown Source)  
> at processing.sound.AudioSample.play(Unknown Source)  
> at processing.sound.SoundFile.play(Unknown Source)  
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)  
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  
> at java.lang.reflect.Method.invoke(Method.java:498)  
> at org.python.core.PyReflectedFunction. **call** (PyReflectedFunction.java:188)  
> at org.python.core.PyReflectedFunction. **call** (PyReflectedFunction.java:206)  
> at org.python.core.PyObject. **call** (PyObject.java:497)  
> at org.python.core.PyObject. **call** (PyObject.java:501)  
> at org.python.core.PyMethod. **call** (PyMethod.java:141)  
> at org.python.pycode.\_pyx53.shows$4(BetterShip.pyde:78)  
> at org.python.pycode.\_pyx53.call\_function(BetterShip.pyde)  
> at org.python.core.PyTableCode.call(PyTableCode.java:171)  
> at org.python.core.PyBaseCode.call(PyBaseCode.java:125)  
> at org.python.core.PyFunction. **call** (PyFunction.java:403)  
> at org.python.pycode.\_pyx53.draw$2(BetterShip.pyde:39)  
> at org.python.pycode.\_pyx53.call\_function(BetterShip.pyde)  
> at org.python.core.PyTableCode.call(PyTableCode.java:171)  
> at org.python.core.PyBaseCode.call(PyBaseCode.java:125)  
> at org.python.core.PyFunction. **call** (PyFunction.java:403)  
> at org.python.core.PyFunction. **call** (PyFunction.java:398)  
> at jycessing.PAppletJythonDriver.draw(PAppletJythonDriver.java:1370)  
> at processing.core.PApplet.handleDraw(PApplet.java:2476)  
> at processing.awt.PSurfaceAWT$12.callDraw(PSurfaceAWT.java:1547)  
> at processing.core.PSurfaceNone$AnimationThread.run(PSurfaceNone.java:313)

---

<div class="post-metadata">

### Author: ![Sky](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/sky/32/3013_2.png) [@Sky](https://discourse.processing.org/u/Sky)
#### Post date: [February 24, 2019, 8:56pm UTC](https://discourse.processing.org/t/very-tiny-little-micro-game-what-do-you-think-about-this/8697/3 "2019-02-24T20:56:39Z")

</div>

Ok, thanks  
For your problem, I think its because you havent installed the sound (‘sound’) library.  
You can delete line 4(where i add the library) 11(where I load the sound) 69(thi should be an if statement) 70(where I play the sound), or download it.  
I personally drew the ships and projectile sprites, while for the explosion sprite I took it from [here](https://opengameart.org/content/2d-explosion-animations-frame-by-frame)(where I also took the sound effect).  
Yeah, F is pretty akward, and for diagonal movement, I have [this old topic](https://discourse.processing.org/t/solved-diagonal-movement/6978/4)  
(I will add diag movement _asaiantl (as soon as im not too lazy)_ )

---

<div class="post-metadata">

### Author: ![glitching.world](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glitching.world/32/3844_2.png) [@glitching.world](https://discourse.processing.org/u/glitching.world)
#### Post date: [February 24, 2019, 9:15pm UTC](https://discourse.processing.org/t/very-tiny-little-micro-game-what-do-you-think-about-this/8697/4 "2019-02-24T21:15:52Z")

</div>

I found out the problem `enemxplosion = SoundFile(this,"C:\\Users\\user\\Desktop\\PDE-Projects\\AProj\\Python\\BetterShip\\data\\EnemExplosion.wav")` this should be a relative path since it changes from computer to computer, I don’t use de Python Mode at all so I couldn’t made it work. But I do have the “sound” library installed and I tried: `enemxplosion = SoundFile(this,"EnemExplosion.wav")` and moved the file to the root folder and yet it gave me the same error 🤔 it’s likely that there’s more to this than the path to the file.

Also I noticed that the enemies hit box is shifted to the right, if the bullet is from the center of the image to the left it won’t register the hit, but from the center of the image to the right it will register even if you missed the target.

Overall I think it looks nice and it can make a neat time waster game for mobile. I did something similar for a class mini project once in Android Mode, but I lost the code 🤣

---

<div class="post-metadata">

### Author: ![Sky](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/sky/32/3013_2.png) [@Sky](https://discourse.processing.org/u/Sky)
#### Post date: [February 25, 2019, 1:13pm UTC](https://discourse.processing.org/t/very-tiny-little-micro-game-what-do-you-think-about-this/8697/5 "2019-02-25T13:13:37Z")

</div>

![shitboxe](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/6/6e83ad8d9c959ffbfef414897886a22a86a8bd82.png)  
(This is not a hit)  
Thx for noticing my shitboxes, but for the sound, I Putin 😉 the absolute path bc it didnt worked from data folder as worked for the animations

---

<div class="post-metadata">

### Author: ![glitching.world](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glitching.world/32/3844_2.png) [@glitching.world](https://discourse.processing.org/u/glitching.world)
#### Post date: [February 26, 2019, 12:43pm UTC](https://discourse.processing.org/t/very-tiny-little-micro-game-what-do-you-think-about-this/8697/6 "2019-02-26T12:43:11Z")

</div>

You welcome 🙂 sorry can’t be more helpful, what you are trying to do goes beyond my knowledge.
