Topic:   Legendary Sword   (Read 20060 times)


0 Members and 1 Guest are viewing this topic.

Silverwind


  • ^ This guy is amazing.

  • ****


  • Posts: 2805

  • For the glory of my maker
Legendary Sword
« on: April 20, 2015, 09:01:37 PM »
For the gazillionth time I've got a hankering to make a simple grid based RPG (it happens every time I'm sick for some reason), so I've dug out my old javascript and I'm working on an interface concept.

If anyone's interested, I'll pop up-to-date builds on dropbox:

https://www.dropbox.com/s/b50b0kcqvy5pl6v/build3.zip?dl=0
« Last Edit: April 22, 2015, 06:39:50 PM by Silverwind-san »
I survived the spammage of 2007

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: Legendary Sword
« Reply #1 on: April 21, 2015, 01:54:50 AM »
That is hecka cool!

I love how you did it with minimal lines of code.

Easter egg: Press Z and X to switch rooms. Press C and V to switch character.


If you want me to help out- just tell me very specific things to do. (emphasize the specific) I have plenty of time.

Connors


  • ^ This guy is amazing.

  • ****


  • Posts: 2374

  • It's a secret to everyone...
Re: Legendary Sword
« Reply #2 on: April 21, 2015, 02:53:57 PM »
Don't listen to Gan he will abandon it as soon as he gets bored with using Javascript. He's a dirty traitor.
Warning: The above post may have been modified multiple times.

"In a great game, the character must never perfectly obey the user's command"
 - Tim Rogers

http://connorspuzzles.tumblr.com/

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: Legendary Sword
« Reply #3 on: April 21, 2015, 08:26:11 PM »
That's why the specific task has to take at max 4 hours. I'll get distracted with another project.

Silverwind


  • ^ This guy is amazing.

  • ****


  • Posts: 2805

  • For the glory of my maker
Re: Legendary Sword
« Reply #4 on: April 22, 2015, 06:53:07 PM »
Easter egg: Press Z and X to switch rooms. Press C and V to switch character.

Oh yeah, I probably should have mentioned that the movement controls were WASD ;D

I cleaned up the code a bit this evening and updated the file. The link from my first post will stay valid :)

Room switching now works properly, and I'll have a whack at the view structure next, so that the player will remain in the centre of the screen when he moves and the room will scroll behind him. After that I'll work on npcs, and the Game Maker Roguesoft RPG Engine will be pretty much ported in no time! (assuming I actually keep working on the project, like I usually don't)

If you want me to help out- just tell me very specific things to do. (emphasize the specific) I have plenty of time.

That's coolabool of you :D I'm sure I'll have plenty of troubleshooter questions as JavaScript stumps me along the road of progress.
I survived the spammage of 2007

Silverwind


  • ^ This guy is amazing.

  • ****


  • Posts: 2805

  • For the glory of my maker
Re: Legendary Sword
« Reply #5 on: April 23, 2015, 07:32:30 AM »
Sorted out the new room view structure, which can be toggled by pressing z. I updated the file too.
I survived the spammage of 2007

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: Legendary Sword
« Reply #6 on: April 23, 2015, 05:36:46 PM »
Fascinating!

Silverwind


  • ^ This guy is amazing.

  • ****


  • Posts: 2805

  • For the glory of my maker
Re: Legendary Sword
« Reply #7 on: April 25, 2015, 06:46:12 AM »
Hey Gan, GM had a command called spritePath which moved a sprite from it's current location to a specified location, drawing the sprite x amount of times along the way. For example:

Code: [Select]
sprite spriteIndex 0 0 "Elf.gif"
spritePath spriteIndex 100 100 4

That would draw a sprite at 0px, then draw it at 25px, 50px, 75px, and finally 100px. But here's the important bit: any code that comes after the spritePath command is only executed after the animation sequence. I can't figure out how to make an equivalent method in in JavaScript. Any ideas?
I survived the spammage of 2007

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: Legendary Sword
« Reply #8 on: April 25, 2015, 07:19:28 AM »
I think the easiest would be to use a setTimeout. setTimeout runs code after a delay.
Code: [Select]
setTimeout(function() { 
//Code to run after delay

},millisecondDelay);

Here's an example animation
Code: [Select]
moveSprite(myCharacter, 0, 100);
setTimeout(function() {
   moveSprite(myCharacter, 25, 100);
   setTimeout(function() {
      moveSprite(myCharacter, 50, 100);
         setTimeout(function() {
            moveSprite(myCharacter, 75, 100);
            setTimeout(function() {
               moveSprite(myCharacter, 100, 100);
               setTimeout(function() {
                  //Do other stuff after animation

              }, 50);
           }, 50);
        }, 50);
     }, 50);
 }, 50);

It's not very pretty but it should get the job done.
If this isn't what you want, point me to your code with a description of what you'd like and I'll come up with a solution.

Silverwind


  • ^ This guy is amazing.

  • ****


  • Posts: 2805

  • For the glory of my maker
Re: Legendary Sword
« Reply #9 on: April 25, 2015, 09:02:39 AM »
Ah, that will do it! :D Thanks Gan. I've got the day/night cycle ported now, as well as basic npc existence. I've just gotta port the old NPC AI, write a new spawner, and most of the engine is complete. I've got some fancy ideas for dynamic lighting I'd like to tinker with too, but all in time...

EDIT:

Here's a visual update: https://youtu.be/jKXzcSbECnA

I'm really pleased with how it's shaping up :)
« Last Edit: April 25, 2015, 09:15:01 PM by Silverwind »
I survived the spammage of 2007

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: Legendary Sword
« Reply #10 on: April 26, 2015, 11:09:16 PM »
That is really cool. And like always, I really enjoy your accent.

WarHampster


  • GMG Extraordinaire

  • ***


  • Posts: 1501

  • The People's Moderator
    • Arcade of the Absurd
Re: Legendary Sword
« Reply #11 on: April 28, 2015, 03:29:48 AM »
I don't believe it, a new Silverwind game! This makes me so happy :)

Dunno how you're making the levels but I hope it's not still hard-coded 2D arrays. Check out Tiled maybe, here's an example of using it in JavaScript: https://github.com/batiste/sprite.js

look in tests/mapeditor

Silverwind


  • ^ This guy is amazing.

  • ****


  • Posts: 2805

  • For the glory of my maker
Re: Legendary Sword
« Reply #12 on: April 28, 2015, 09:40:38 AM »
Nice to hear from you sir!

Yeah, I'm still punching the 0's and 1's by hand ;D I was thinking about Tiled the other night funny enough though, because I haven't looked at it in some years but recall playing with it at one point. Progress is gonna be fairly on hold during May, but I might check it out when I resume in June.

Your website's coolabool :) Big fan of the massive header!
I survived the spammage of 2007

Connors


  • ^ This guy is amazing.

  • ****


  • Posts: 2374

  • It's a secret to everyone...
Re: Legendary Sword
« Reply #13 on: April 29, 2015, 10:52:37 PM »
I like Tiled, it seems to have a lot of export options. You could probably even get it to export 1's and 0's or ASCII characters or whatever you need. :L
Warning: The above post may have been modified multiple times.

"In a great game, the character must never perfectly obey the user's command"
 - Tim Rogers

http://connorspuzzles.tumblr.com/

addseo1115


  • GMG Newbie

  • *

  • no avatar

  • Posts: 3

  • Gan is so awesome.
Re: Legendary Sword
« Reply #14 on: May 01, 2015, 02:14:28 AM »
Thanks that's what I'm looking for.