Creative Coder/Multimedia Artist/Performative Programmer : Engineering Thru Creative Means and Providing Experiences
AstroBattleShips
For this week's Creative Code Challenge by @sableraph: " Classic Boardgames, AstroBattleShips takes Python, Locomotion & SonicPi Code with Digital Media to reimagine the game, Battleship as an intergalactic game.
Imagination Stage
This is done by using a modified version of Battleship that uses mines and having the layout of the board code in Python. The dark blue represents the mines while the lighter blue represents the ships.
In SonicPi, the sounds that are drum-like represent a mine being located while the beeps are for the ships. The overall ambience sound is the open water on the board.
By using 360 alongside some filters, a sci-fi representation can be seen of how board games can be played in a futuristic realm. WIth Locomotion to add actual ships.
Poetry
Where are they located?
How have they been Created?
Will this lead to a feeling frustration
As there is no instruction,
And needs a bit of intuition?
Video
Images of the Boards
Code
Python
#battleship is a 10 x 10 board game, for the purpose of this, we will be arranging various new classes of shipsimport numpy as np
import seaborn as sns #using the data viz component as a boardimport matplotlib.pylab as plt
defbattle():#using the 0 & 1 to represent a ship versus the ocean and having a weighted value of 0.8 for ocean, 0.18 for boats and 0.02 for mines
boats = [0,1,2]
prob = [0.78, 0.18,0.04]
#by adding the (10,10) instead of 5, able to make an array with the weighted values
shipyard2 = np.random.choice(boats, (10,10), p=prob)
return shipyard2
defplotting(x):
letters = ['A','B','C','D','E','F','G','H','I','J'] #set for the columns
uniform_data = x
ax = sns.heatmap(uniform_data, linewidth=0.5,cmap="Blues") #changing it to blue for ocean representation
ax.set_xticklabels(letters) #setting the ticks of the x axis to letters
plt.show()
return x #to produce array that will be used in sonicpi
plotting(battle())