Blok: Movable Terrain Demo

Ask and answer questions about making games and related topics. Unrelated topics go in that other forum.

Moderators: marionline, SDHawk

Post Reply
User avatar
Taco Bot
Meat, Cheese, and Silicon
Posts: 484
Joined: Fri Jul 18, 2014 12:15 am
Location: Santa Cruz
Contact:

Blok: Movable Terrain Demo

Post by Taco Bot »

Alright! It's time to pop the champagne cork and celebrate the new Q&A Forum!

Although I made this demo three days ago, I felt that since I never made a post about it, this would be the place to do so.

I experimented with reading and writing map blocks, and made a little tech demo. Currently you can pick up blocks, adding to the counter at bottom left of the screen, and place them, subtracting from it.

I may not have made the process as streamlined as I could, and it has a few bugs that I had to (sort of) cover up, but I made sure to comment every single darned line of code to make it more understandable.

http://www.slimesalad.com/forum/viewgame.php?t=6476
Sent from my iPhone
User avatar
spheroidal_defence
Red Slime
Posts: 25
Joined: Mon Aug 04, 2014 10:13 pm
Location: CCCP

Post by spheroidal_defence »

The question is deeply hidden in your statement. Please reveal the truth behind what you said. Allow me the fulfill my Q&A dreams and bring forth the question.
reinterpret_cast<ClassB>(a);
User avatar
sheamkennedy
Liquid Metal Slime
Posts: 1110
Joined: Mon Sep 16, 2013 9:29 pm
Location: Tama-shi, Tokyo, Japan
Contact:

Post by sheamkennedy »

I love this demo. Besides it being simple I see a lot of potential for it to be used in a puzzle-like game.

Perhaps you could make a game that only allows the player to pick up a maximum of 1 box at a time. The game could have buttons so if you place the box on a button it would hold the button down and open doors or carry out other tasks. You could have bloodthirsty monsters which can be avoided by strategically placing boxes in a wall-like pattern to reach the goal. Maybe the character can't swim and must place boxes in water to make bridges. You could even add a little animation so when you pick a box up your character holds it above their head... I can see a lot being done with this. Id love to play a game like this, especially if the puzzles got very difficult.
⊕ P E R S O N A L M U S I C: https://open.spotify.com/album/6fEo3fCm5C3XhtFRflfANr
� C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

The style of indenting reminds me of sheamkennedy's avatar. It looks like this:

Image

To remove the redundancy, you can loop over the 4 directions using the dir X and dir Y scripts here: http://rpg.hamsterrepublic.com/ohrrpgce ... dump#Maths

Also, notice that there's asymmetry between the controls when walking left, and when walking right. That's because when you're partway between tiles, hero X/Y return the tile to the up-left.
User avatar
Taco Bot
Meat, Cheese, and Silicon
Posts: 484
Joined: Fri Jul 18, 2014 12:15 am
Location: Santa Cruz
Contact:

Post by Taco Bot »

TMC wrote: To remove the redundancy, you can loop over the 4 directions using the dir X and dir Y scripts here: http://rpg.hamsterrepublic.com/ohrrpgce ... dump#Maths
I tried to do that, but messed something up big time in the process (shows just how good of a coder I am).
Also, notice that there's asymmetry between the controls when walking left, and when walking right. That's because when you're partway between tiles, hero X/Y return the tile to the up-left.
I did notice that, and is there any way to fix it?
Sent from my iPhone
User avatar
Bob the Hamster
Lord of the Slimes
Posts: 7658
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

Taco Bot wrote:
TMC wrote:Also, notice that there's asymmetry between the controls when walking left, and when walking right. That's because when you're partway between tiles, hero X/Y return the tile to the up-left.
I did notice that, and is there any way to fix it?
I think that you can work around that by doing something like this:

Code: Select all

script, hero center x, who, begin
  exit returning&#40;&#40;hero pixel x&#40;who&#41; + 10&#41; / 20&#41;
end

script, hero center y, who, begin
  exit returning&#40;&#40;hero pixel y&#40;who&#41; + 10&#41; / 20&#41;
end
Add those scripts, and then when you want to get the position of the hero, use "hero center x" instead of "hero x" and "hero center y" instead of "hero y"
Last edited by Bob the Hamster on Fri Feb 13, 2015 6:15 pm, edited 1 time in total.
Post Reply