1 decade ago by Aristy
Hi,
I'm working on a Diablo like game. So far I managed to solve many things on my own, like shrines, health bars, health globes, gold drops, skills, projectiles, bosses, mob AI etc.
Here are my questions:
Question 1
Right now my interface looks like this: http://i.imgur.com/cZQZFMF.jpg
However, what I want is; when I press DOWN, it should go continue. When I press DOWN again, it should go credits. However, I couldn't understand how can I make a "<" icon to point where we are.
Right now it looks like this:
All I need to learn is how to make remove a font once they appear on init method. For example, when I press DOWN, "<" font has to be visible on "Continue", when I press DOWN again, "<" it has to be visible on "Credits".
Question 2
I need some music methods like:
Can anyone give me ideas how to implement those?
Question 3
Right now, when I move on "gold" with my PlayerEntity, I can pickup the gold. However, when I shoot a projectile to it, "Gold" entity disappears. Also, when I shoot a projectile to warp gates, it teleports my PlayerEntity to next instance.
Do I have wrong collision attributes set or am I doing something wrong?
Source is here: http://paste.laravel.com/1gaS
Question 4
When I kill a boss entity, boss drops some gold entities on ground (throws drops randomly in 60/60 range). However, there is a possibility those entities may spawn on collision objects, so my player can't move to them to pickup.
How can I check if target X,Y is on a collision object?
Question 5
I need to clean up my main.js a bit. Right now it is like:
I need my main.js just for general methods and loading purposes. How can I do this?
Ps. Think it like front controllers in backend languages such as PHP. My main.js should do something like.
Question 6
As for inheritence, how can I make my projectiles inherit from main projectile object?
For example,
right now these two entities are the skills my PlayerEntity is using, however both look exactly the same, except:
- They use different images and animations
- BigProjectile deals more damage
- BigProjectiles travels slower
Apart from that, all the boilerplate code is the same. (like init, check, collision etc.)
Can I do something like:
I'm working on a Diablo like game. So far I managed to solve many things on my own, like shrines, health bars, health globes, gold drops, skills, projectiles, bosses, mob AI etc.
Here are my questions:
Question 1
Right now my interface looks like this: http://i.imgur.com/cZQZFMF.jpg
However, what I want is; when I press DOWN, it should go continue. When I press DOWN again, it should go credits. However, I couldn't understand how can I make a "<" icon to point where we are.
Right now it looks like this:
this.font.interface.draw("1", 270, 293); this.font.interface.draw("2", 270, 355); this.font.interface.draw("3", 270, 411);
All I need to learn is how to make remove a font once they appear on init method. For example, when I press DOWN, "<" font has to be visible on "Continue", when I press DOWN again, "<" it has to be visible on "Credits".
Question 2
I need some music methods like:
ig.music.playOnce(); //to play music only once ig.music.isPlaying(); //to keep track if there is a music playing ig.music.groupBy('townMusics'); //so I can play town musics when I am in town, play boss musics when I fight boss etc.
Can anyone give me ideas how to implement those?
Question 3
Right now, when I move on "gold" with my PlayerEntity, I can pickup the gold. However, when I shoot a projectile to it, "Gold" entity disappears. Also, when I shoot a projectile to warp gates, it teleports my PlayerEntity to next instance.
Do I have wrong collision attributes set or am I doing something wrong?
Source is here: http://paste.laravel.com/1gaS
Question 4
When I kill a boss entity, boss drops some gold entities on ground (throws drops randomly in 60/60 range). However, there is a possibility those entities may spawn on collision objects, so my player can't move to them to pickup.
How can I check if target X,Y is on a collision object?
Question 5
I need to clean up my main.js a bit. Right now it is like:
gameOver = ig.Game.extend({ gameStart = ig.Game.extend({ game = ig.Game.extend({
I need my main.js just for general methods and loading purposes. How can I do this?
Ps. Think it like front controllers in backend languages such as PHP. My main.js should do something like.
var gameStart = this.loader.load('gameOver.js'); //so I can put logic into gameOver.js
Question 6
As for inheritence, how can I make my projectiles inherit from main projectile object?
For example,
projectileSmall (Entity) projectileBig (Entity)
right now these two entities are the skills my PlayerEntity is using, however both look exactly the same, except:
- They use different images and animations
- BigProjectile deals more damage
- BigProjectiles travels slower
Apart from that, all the boilerplate code is the same. (like init, check, collision etc.)
Can I do something like:
abstract EntityProjectileModel = ig.Entity.extend({ //Boilerplate code! //Collision, check, init, things like that. }) EntityBigProjectile = ig.EntityProjectileModel.extend({ animSheet: ..., damage: 500, speed: 300 }) EntitySmallProjectile = ig.EntityProjectileModel.extend({ animSheet: ..., damage: 200, speed: 600 }) Thank you.