Peake RPG... I'm really thinking about it

avatar


https://geocities.ws/peakecoin/games/The%20Peake/index.html

I'm not the smartest when it comes to the front end either. So learning and having resources accessible is a big help...

@thecrazygm this is one of the cool things I have in the works. I'm having a lot of trouble with the other one, but once I'm stumped, I'll start uploading my lost process.

...so let the games begin.

My next big leap is logging in and saving it the Nintendo way.
I started working on a little text-based game. So far, single player, but I haven't gotten very far with it. If anyone else wants to jump in and help, I'm all for it.

There is definitely a need for more games and things incorporated with the blockchain. My thought was that a text-based game could easily transition into an app for Android or at least in the Hive Keychain under a dApp but it would be much more effective in the "App Market" if you feel me.

Is there an easier way to blockquote code in blog posts? The codes I try don't really work as much as the 4 spaces.

This is where we're at as of today.

index.html

<!DOCTYPE HTML>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Peake RPG</title>
  <style>
body { font-family: monospace; background: #111; color: #eee; padding: 20px; }
#output { white-space: pre-wrap; margin-bottom: 20px; }
button { margin: 5px; }
 </style>
</head>
  <body>

 <h1>Text RPG</h1>
 <div id="output">Loading...</div>

 <div>
<button onclick="move('n')">North</button>
<button onclick="move('s')">South</button>
<button onclick="move('e')">East</button>
<button onclick="move('w')">West</button>
  </div>

 <h3>Character</h3>
 <div id="stats"></div>

 <h3>Inventory</h3>
 <ul id="inventory"></ul>

<h3>Save / Load</h3>
<button onclick="saveGame()">Copy Save Code</button>
<button onclick="downloadSave()">Download Save</button>
<input type="text" id="loadInput" placeholder="Paste save code" style="width: 300px;">
<button onclick="loadGame()">Load</button>

  <script src="maps.js"></script>
  <script src="characters.js"></script>
  <script src="shop_items.js"></script>
  <script src="shop.js"></script>
  <script src="games.js"></script>

</body>
</html>

I'm not sure but @ddrfr33k if you check this out... are you interested in helping me make the game? Or any parts of it? Either way thanks.



0
0
0.000
24 comments
avatar
press tab at the start of each line

or there is the

```
language

```

I think that is what you are asking about.

0
0
0.000
avatar

Yes that is exactly what I'm asking about. I just want to copy and paste the code from visual code to the window and have it look more clean than having to tab my way.

0
0
0.000
avatar

Peakd has that standard in the editor, just click 1 button then paste your code. Glad I could help.

0
0
0.000
avatar

Really? I'm going to have to check that out for the next post in this little game series... You interested in helping on this? Need maps, characters, NPCs, shops, I'm only one person lol.

0
0
0.000
avatar

I will be reading for sure, if I can catch on to how it works maybe. I do need practice with making stuff work together, so helping out with small parts here and there would be good for me. I am quickly learning it is easy for me to get in over my head at this point.

0
0
0.000
avatar

You want me to give you something to work on? How about a grid map in javascript? 10 x 10.... you can lay it out and give it to me even without the javascript. I will need coordinates though. 0,0 for the center. It will allow me to focus on characters and logging in.

0
0
0.000
avatar
(Edited)

lol not yet, I wouldn't even know where to start on that. err well I guess its just 2 variables with random ++ or -- numbers assigned, and constrained by +10 or -10. I have no clue how to do 0 as center with an even number on the x or y axis. It would work out to 11x11 or 9x9 unless I am missing something. (Most likely)

+5 and -4 would be 10x10 actually!

ffs fine I will go read something and maybe reply soon....
sorry about the rambling reply, lmao just typed it as I was thinking.

Edit: random doc links

! [secrets defiantly not more mistakes java edition]
[import java.until.random}>(https://www.geeksforgeeks.org/generating-random-numbers-in-java/)
VS Code says type script IDK why I missed you said javascript.

// Generate random integers in range 0 to 10
int r1 = r.nextInt(10);
int r2 = r.nextInt(10);

// Printing random integers
System.out.println("Random Integers: " + r1);
System.out.println("Random Integers: " + r2);

this editor doesn't have the code block button, and ya the constant tab over is tedious

ps TIL the > is how people do that line on the side thing and spoilers require a > on empty lines to include the next block.

0
0
0.000
avatar

window.gameMap = {};

for (let y = 0; y < 10; y++) {
for (let x = 0; x < 10; x++) {
const key = ${x},${y};
let desc = "";

if (x === 5 && y === 5) {
  desc = "You arrive at the central plaza...";
} else if (y === 0) {
  desc = "To the north lies a jagged cliff...";
} else if (x === 0) {
  desc = "A thick forest lines the western edge...";
} else if (x === 9 || y === 9) {
  desc = "Here the land fades into shadows...";
} else {
  desc = `A quiet patch of land at coordinates (${x}, ${y}).`;
}

window.gameMap[key] = desc;

}
}

0
0
0.000
avatar
(Edited)

I don't remember, but for - integers in java it would have to be a float, or is that just in C?

image.png

the line : "public static void main" may just be throwing me off and making me think of (int main void) from that Harvard cs50 class.

Edit: just being dumb java is 32 bit integer limit both + and -

0
0
0.000
avatar

Ok I gave it a decent shot for a couple hours, and missed the mark bigtime. No promises but I may jack with it over the next couple days to see if I can figure it out.

0
0
0.000
avatar

Give me whatever you got in a few days and I'll clean it up. I do suggest plugging your code into chatgpt to see where you're missing the mark. That way you don't need to worry about asking anyone.

0
0
0.000
avatar
(Edited)

well this kind of came out of no where and is a crutch to my biggest problem trying to write anything useful.

Mozilla dev tools has a pre set up environment to test code as you write it. How do I do this correctly in vs code.

function getRandomInt(max) {
  return Math.floor(Math.random() * max);
}

x=(getRandomInt(10));
y=(getRandomInt(10));

console.log(x,y);

console.log(x-4,y-4);


clearly I don't know enough to use this very well, but I think it gets the job done. const handling I don't fully understand as well, but I think it is persistent through files but editable by any file.

0
0
0.000
avatar

I'm not sure if I'm reading what you're writing correctly. What are you asking specifically?

0
0
0.000
avatar

1 will that work for your purpose?
2 how do I set up an environment like Mozilla dev tools has in VS code?

0
0
0.000
avatar

The extensions more than likely will do whatever you need. It even offers auto conpletiom and It runs a debug mode.

0
0
0.000
avatar

Thanks I will go dig through the plugins, and try to better understand "const" in javascript.

let me know if that (x,y) rng generator works with what you have so far.

0
0
0.000
avatar

I'm thinking the maps need to be a list with the coordinates (x,y) and the map description. So the game file calls the map file for description of positions.

0
0
0.000
avatar

Sorry it took me a couple more days just to come up with some questions. I don't know much about building games, but I play a ton lol. What is the intended theme? what time period is it set in? what kind of characters like human, mixed species like WoW, Aliens? Is this planned to be like the old text based games like Oregon Trail, or more like a point and click to walk game? Are the spawn locations a central point in a biome, or just different spots in a general area?

The creative part seems harder than looking for example code to pull apart and remake the way you need it.

0
0
0.000
avatar

I've already started uploading some things to the website. Feel free to check where I'm at. It's in the post

0
0
0.000
avatar

You flatter me, but I'm a shit coder and I know it. I'm just good at playing games and being a pretty face. Just ask @chiren!

0
0
0.000
avatar

Any bit helps.... a little chat gpt... some google... some questions... and you'll be surprised what you can churn out.

0
0
0.000
avatar
(Edited)

lamo me too! but even when I am messing up I tend to learn something else.

Edit: Followed you on twitch btw

0
0
0.000
avatar

Oh hey, thanks! Maybe I'll see you in chat one of these nights.

0
0
0.000