[Feedback] [RELEASE] Battleship!

All about the past, current and future webteases and the art of webteasing in general.
---
User avatar
aseeker2000
Explorer
Explorer
Posts: 31
Joined: Mon Dec 02, 2013 2:22 pm
Gender: Male
Sexual Orientation: Open to new ideas!
I am a: Submissive

Re: [Feedback] [RELEASE] Battleship!

Post by aseeker2000 »

I loved it....next one please add more ball slaps. Maybe a ridiculous amount.

aseeker2000
== Results from bdsmtest.org ==
100% Degradee
100% Rope bunny
97% Brat
91% Submissive
88% Masochist
86% Experimentalist
81% Primal (Prey)
76% Boy/Girl
67% Exhibitionist
67% Slave
56% Non-monogamist
45% Voyeur
44% Pet
41% Ageplayer
35% Switch
18% Vanilla
14% Degrader
7% Dominant
5% Sadist
4% Rigger
2% Brat tamer
1% Primal (Hunter)
1% Master/Mistress
1% Daddy/Mommy
0% Owner


[email protected]
(Use Google Chat or email to communicate with me)
tom.hevenaars
Explorer
Explorer
Posts: 12
Joined: Sun Oct 17, 2021 6:49 pm

Re: [Feedback] [RELEASE] Battleship!

Post by tom.hevenaars »

Thank you for the tease, I enjoyed it! I do agree that it'd be a lot better if some better game mechanics got added, like actual ships instead of single hits or misses, etc.

I read that you could use some help with the javascript code, so I created the code for the game with some handy variables and functions to make it easy to integrate into your tease. Hope this helps!

You can find the code in the attachment battleship.js, if you want to quickly test it out, you can add the code in the file battleshipTryOut.js to the bottom of it (battleship.js) and run it with node in a terminal (node battleship.js).

When starting the game, you need to run the function startNewGame().

The variables you can access at any point during the game:
state.lastEnemyGuess (Position with x & y property, ex: state.lastEnemyGuess.x)
-> on Position objects, you can add .toString() to turn it into a text, ex: state.lastEnemyGuess.toString() -> "B6"
state.lastUserGuess (Position)
state.didLastEnemyGuessHit (true or false)
state.didLastUserGuessHit (true or false)
state.didLastEnemyGuessSinkShip (true or false)
state.didLastUserGuessSinkShip (true or false)
state.enemyShipsLeft (number)
state.userShipsLeft (number)
state.enemyHasShipOnRowOfLastGuess (true or false) (can be used for showing hints)
state.enemyHasShipOnColumnOfLastGuess (true or false) (can be used for showing hints)
state.hasEnemyLost (true or false)
state.hasUserLost (true or false)

The functions you can run:
startNewGame()
makeEnemyGuess() (enemy will guess in a smart way based on previous guesses)
makeUserGuess(x, y) (index based, so starts at 0, example: makeUserGuess(0, 4) )
makeUserGuessByTarget(row, column) example: makeUserGuessByTarget("B", 7)
-> does the same thing as the one above, just maybe a bit easier to use, column also starts at 1 here, not 0. It's how you'd actually say it if you were playing the game (or which buttons you would press in the tease)
-> the column can also be a string, it'll work as well

There are also 2 render functions, which will return a text representing the grid (so you can visualize the game board without needing images):
renderUserGuessGrid() renders the misses, hits & ships sunk that the user already has done to the 'enemy'
renderUserShipsWithHitsGrid() renders the ships of the player itself, and which ones the 'enemy' has already hit or sunk

If you have any questions, run into problems or need something updated, feel free to reach out.
Attachments
battleship-2.zip
(4.07 KiB) Downloaded 30 times
Last edited by tom.hevenaars on Tue Oct 17, 2023 11:38 pm, edited 1 time in total.
bbb11__
Explorer
Explorer
Posts: 40
Joined: Thu May 18, 2023 7:43 pm

Re: [Feedback] [RELEASE] Battleship!

Post by bbb11__ »

Wow! That’s a lot of awesome things to add!

I don’t have the coding skills to do a lot of this and got confused even reading some of it haha. I’ll try to read through it again another time. I appreciate all of the feedback and ideas!

The smart guessing is really cool. I wanted to make the computer smarter but had no idea how to even start that.
If you were to release your own version with a lot of these adds, I’d totally play it!

Thanks for putting together such a thoughtful and cool response!! Thanks!
tom.hevenaars
Explorer
Explorer
Posts: 12
Joined: Sun Oct 17, 2021 6:49 pm

Re: [Feedback] [RELEASE] Battleship!

Post by tom.hevenaars »

bbb11__ wrote: Tue Oct 17, 2023 7:56 pm If you were to release your own version with a lot of these adds, I’d totally play it!
Thanks for that! I've started on my own version, it currently works with the game system. Now I only need to add images, creative instructions and audio beats. Will keep you posted!

Also, the code I posted didn't fully work in EOS because of EOS's limitations. The render methods didn't render the board properly as well since EOS renders with a different font & logic than a console does.
If you (or anyone) is interested, I updated my code and will attach it to this reply.

For the curious - how I got the rendering to work:
In EOS, almost every character (letters, numbers, emojis) has a different width, so you can't just simply create a grid, it'll look wonky.
I fixed it by adding tiny spaces ( ) in front and after each character, so that they all become the same width'.
So the letter 'I' needs 3 tiny spaces in front and 3 tiny spaces after, and the letter D is the widest (of chars I use) which doesn't need any. Then the strings being displayed (from A - J) will look like this:

Code: Select all

 A 
 B 
 C 
D
  E 
  F  
G
H
   I   
  J     
This was very tedious to code, but now it works :-D
Attachments
battleship-updatedForEos.zip
(4.58 KiB) Downloaded 34 times
tom.hevenaars
Explorer
Explorer
Posts: 12
Joined: Sun Oct 17, 2021 6:49 pm

Re: [Feedback] [RELEASE] Battleship!

Post by tom.hevenaars »

bbb11__ wrote: Tue Oct 17, 2023 7:56 pm If you were to release your own version with a lot of these adds, I’d totally play it!
Now released :) viewtopic.php?t=26530
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests