Poll

I'm not sure how to delete this pole.

Ok, cool.
0 (0%)
That's lame.
0 (0%)
Alright, you're kindof stupid.
2 (100%)
I don't care, I'm just here for the free cake.
0 (0%)

Total Members Voted: 2

Topic:   Retro games   (Read 347866 times)


0 Members and 6 Guests are viewing this topic.

x


  • GMG-er

  • **


  • Posts: 247
Re: Retro games
« Reply #360 on: February 18, 2012, 07:53:28 PM »
yeah I think the only thing we should have in mind is polymorphism, or adaptability. so that we can change everything in one place instead of searching all over the code. Such as using macros over integer constants, especially the ones used more than once. and most things through functions. I may go through myself and try to do that.

class monster
//blah
endclasee

class whatever extands monster
endclass

all functions accept type monster.

Inheritance is the answer.

Charlo


  • GMG-er

  • **


  • Posts: 451
Re: Retro games
« Reply #361 on: February 18, 2012, 08:23:11 PM »
Inheritance in JavaScript is not intuitive.  Unless the HTML5 GM has it built in and I'm not aware of it.  I have done it like this (I grabbed the technique off a discussion on some site on how to do inheritance in JavaScript):

Code: [Select]

function enemy(x, y) {
var hp;
var x;
var y;
var startingHp;
var movable;
var chases;
var level;
this.x = x;
this.y = y;
}
function demon(x, y) {
this.chases = true;
this.movable = true;
this.level = 1;
this.startingHp = 25;
this.hp = 25;
enemy.call(this, x, y);
}
demon.prototype = new enemy();

Basically, to have the demon inherit from the enemy "class", we need to call the enemy's constructor within the demon's constructor.  Then we set the demon's prototype object to be an enemy, after which we can add methods specific to a demon.  At least that's how I understand it; X or somebody else can correct me if I'm way off.

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: Retro games
« Reply #362 on: February 19, 2012, 12:34:46 AM »
That is correct.

x


  • GMG-er

  • **


  • Posts: 247
Re: Retro games
« Reply #363 on: February 19, 2012, 08:06:01 AM »
Yeh, its just classic prototypal inheritance. It still lets you create an inheritance tree to organize all your game objects, and abstract functions from them.

Also, I am not sure about this, but you could probably do:
demon.inherits(enemy)

If you set them up correctly.

Zoo


  • GMG Extraordinaire

  • ***


  • Posts: 1686
    • My Bandcamp
Re: Retro games
« Reply #364 on: February 20, 2012, 03:32:53 PM »
Hey Gan, Before I write the rough draft of the script, I need to know a few things:
1. First, second, or third person?
2. Past tense or present tense?

thanks
Kirby, your pudgy buddy from dream land, is back again on the game boy®!

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: Retro games
« Reply #365 on: February 20, 2012, 03:43:18 PM »
Didn't think of that.
Could ya give a brief example of each? Then we could vote.

Zoo


  • GMG Extraordinaire

  • ***


  • Posts: 1686
    • My Bandcamp
Re: Retro games
« Reply #366 on: February 20, 2012, 05:27:54 PM »
Ok, this pole is up for 5 days. Vote now.
Kirby, your pudgy buddy from dream land, is back again on the game boy®!

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: Retro games
« Reply #367 on: February 28, 2012, 11:10:55 AM »
The laser is now in!

Connors


  • ^ This guy is amazing.

  • ****


  • Posts: 2374

  • It's a secret to everyone...
Re: Retro games
« Reply #368 on: March 02, 2012, 09:44:16 AM »
Made a slight tweak to the AI. Just look at what they do when you open the door. Sometimes it's the little details that count (starts with the original smiley face level).
http://gamemakersgarage.com/html5/HTML5-ShareGame.php?gameID=229
EDIT: I noticed enemy health already works fine, so I think it's time to start tweaking that and time to add ammo and other status bars. Should be very cool.
@anyone: Should the gun fire in bursts or have a constant beam that has to focus on enemies? I think the basic gun should fire once per button press. We could let the player pick up a laser like this one later. Also, grenades.
EDIT #2: Taking out a piece of a certain condition does, indeed, allow the zombies to shoot lasers. Hilariouse.
EDIT #3: Updated the file above with the following:
 - Mouse to fire ;D
 - One shot per click *(tell me what you think) ???
 - Modified health to be similar to SC space marine (just for an example) so that Green takes one hit, Blue takes two and Red takes three. 8)

Time to make this a real game! XD
« Last Edit: March 02, 2012, 10:47:36 AM by Connors »
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: Retro games
« Reply #369 on: March 02, 2012, 11:14:03 AM »
Awesome! Looks good, I've put your code in the official build.

I got a few extra minutes. I'm gonna add in a basic HP, ammo, bombs, lives, keys GUI.

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: Retro games
« Reply #370 on: March 02, 2012, 11:38:14 AM »
Added in a GUI.
http://gamemakersgarage.com/html5/HTML5-ShareGame.php?gameID=156

Also, how did you modify the AI? I now notice that they twitch randomly in a different direction when walking towards the player.

Edit: Fixed a massive bug in the SQL database. If anything glitchy starts happening(like progress not saving or game not compiling) please PM me.
« Last Edit: March 02, 2012, 12:14:05 PM by Gan »

Connors


  • ^ This guy is amazing.

  • ****


  • Posts: 2374

  • It's a secret to everyone...
Re: Retro games
« Reply #371 on: March 02, 2012, 12:30:18 PM »
Oh well I only change the end of RunAI() so that the zombies don't path to you until the random timer runs out all the way. Now they don't all unanimously change direction the second you open a door. I don't know why it affected the path, that is odd.
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/

Connors


  • ^ This guy is amazing.

  • ****


  • Posts: 2374

  • It's a secret to everyone...
Re: Retro games
« Reply #372 on: March 02, 2012, 12:32:00 PM »
I just now noticed that the laser doesn't come straight out of the gun barrel because of the rotation center. Kind of odd looking.
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/

Zoo


  • GMG Extraordinaire

  • ***


  • Posts: 1686
    • My Bandcamp
Re: Retro games
« Reply #373 on: March 02, 2012, 03:32:11 PM »
I must try it. I have not yet.
Kirby, your pudgy buddy from dream land, is back again on the game boy®!

Connors


  • ^ This guy is amazing.

  • ****


  • Posts: 2374

  • It's a secret to everyone...
Re: Retro games
« Reply #374 on: March 02, 2012, 04:26:20 PM »
So Gan, I'd like to perhaps set up a GUI that fits above or below the screen, probably below... When I have time after homework I will work on ideas.  Also, If you play through that modified level you will notice that as they pour through a doorway the player can just shoot at the doorway and hit them all. I want to start making some that wait until you're closer or they have a line of sight, maybe limit the length of the path they will want to take. I think I'll keep playing with AI.
Also, a great way to set up a challenge later on would be panels that always open groups of doors. Not hard to add but it would mean enemies can then come from different directions.
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/