You are not logged in.
- Topics: Active | Unanswered
#101 Aug 22, 2014 5:09 PM
- Gekoncze
- Baby Dragon
- From: Czech Republic
- Registered: May 16, 2009
- Posts: 5,389
- Gems: 145
- Age: 31 years old
- Gender: Male
Re: Spyroforum Fan Game - Week of June 23rd
Ah, I think I got it now
Hm, what about counting that angle for each line when creating the polygon? And based on the angle it would be wall or ground line. (I'm not sure if it would break anything though)
also in file spyro.js line 46
//Movement and collision with terrain
var speed = Math.sqrt(this.xspeed * this.xspeed + this.xspeed * this.xspeed);
last two speeds - shouldn't there be y?
Last edited by Gekoncze (Aug 22, 2014 5:18 PM)
Offline
#102 Aug 22, 2014 5:36 PM
- Sheep
- Member
- From: Norway
- Registered: Jan 24, 2008
- Posts: 984
- Gems: 5
- Birthday: 20 January
- Age: 31 years old
- Gender: Male
- Website
Re: Spyroforum Fan Game - Week of June 23rd
Ah, I think I got it now
Hm, what about counting that angle for each line when creating the polygon? And based on the angle it would be wall or ground line. (I'm not sure if it would break anything though)
That could work O.o But I think it still would be necessary to test with lines slightly below Spyro.
Edit:{
I mean, we would still need to test that the lines, even if they are "ground" lines, are below Spyro, and not just touching him.
Edit2:
Oh, and I explained it slightly wrong ._.' It's not exactly about the angle of the terrain slopes, but the angle/normal direction from collision point to center of Spyro's circle. Generally, when the collision point is within a line, and not an endpoint, it's practically as if the slope angle decided it, but not if it is a corner point/end point: even a needle sharp turret roof would count as ground, as long as it is placed sufficiently below Spyro.
So yeah, making each line know if it is ground or not is a good idea!
}
also in file spyro.js line 46
//Movement and collision with terrain
var speed = Math.sqrt(this.xspeed * this.xspeed + this.xspeed * this.xspeed);
last two speeds - shouldn't there be y?
Haha, yes it should be y ^^'
Edit:
I did an attempted cleanup. There wasn't much that I felt could actually be cleaned, but I made more thorough comments :S
Last edited by Sheep (Aug 23, 2014 4:53 PM)
Offline
#103 Aug 23, 2014 7:50 PM
- Gekoncze
- Baby Dragon
- From: Czech Republic
- Registered: May 16, 2009
- Posts: 5,389
- Gems: 145
- Age: 31 years old
- Gender: Male
Re: Spyroforum Fan Game - Week of June 23rd
It's ok ^.^ I just didn't understand the code before, I thought it could be done using just one line like "isGround = collisionWithLevelOptimalised( ... )" or something like that.
I commited some changes added gems. I did the commit a coupple of hours after you pushed, so there is a little mess - I thought it would display only the last commit with all the changes, but it generated two commits - one for my changes and one for the merge with your changes (yay I learned how to use merge tool ^.^).
I don't know how to remove objects from the level array. (your code there seems like magic o.o, but it works great )
I don't know how to integrate gem colors with the editor.
When there is gem count, it should be rised in spyro.js in gem x spyro collision. The gem should be also removed from the array there, or just marked as 'alive = false' and then removed later at the end of the step maybe.
Offline
#104 Aug 24, 2014 12:03 PM
- Sheep
- Member
- From: Norway
- Registered: Jan 24, 2008
- Posts: 984
- Gems: 5
- Birthday: 20 January
- Age: 31 years old
- Gender: Male
- Website
Re: Spyroforum Fan Game - Week of June 23rd
When I looked through my code to be able to answer your questions, I realized I had made an oversight... I had intended for objecttypes(objects in the editor's drop-down list) to be able to have a different name than the name of their ingame constructor counterpart(which it does allow), and be added to an array with the same name as the constructor. But I made them go into an array with the same name as the objecttype's name ._.' So my proposed solution, below, to the gem color problem would have had some issues, but I just committed a fix for the above stuff
I commited some changes
added gems. I did the commit a coupple of hours after you pushed, so there is a little mess - I thought it would display only the last commit with all the changes, but it generated two commits - one for my changes and one for the merge with your changes (yay I learned how to use merge tool ^.^).
Nice, nice, nice I like how they move!
I don't know how to integrate gem colors with the editor.
I didn't implement a way to give objects varying sprites in the editor. The nearest thing possible in the editor's currents state is to give the gem object a property for it's color or gem value. The sprite/color could then be set when the object had been loaded in the game, based on that property. To see the value of a gem in the editor, though, you would then have to select it and switch to Edit Mode. So that is not optimal.
What I suggest, is to make a gem object type in the editor for each color/gem value, each object type with it's own sprite, but all with the single, current (ingame) Gem object as the ingame constructor, but with a default "color" or "value" property set to the appropriate value("red", "green" etc or 1, 2, 5, 10 or 25). This property should then obviously not be changed in the individual gems in the editor, but be used by the ingame gem object to determine it's sprite.
The gems would be added to the editor's list of objects like this:
var x = addObjectType("Gem 1", false, false, sprGemRed, Gem);
addObjectTypeProperty(x, "value", "The value of the gem. (Should not be changed)", 1);
var x = addObjectType("Gem 2", false, false, sprGemGreen, Gem);
addObjectTypeProperty(x, "value", "The value of the gem( Should not be changed)", 2);
var x = addObjectType("Gem 5", false, false, sprGemBlue, Gem);
addObjectTypeProperty(x, "value", "The value of the gem( Should not be changed)", 5);
var x = ...
There would a gem of each kind in the drop-down list, and they would all have their appropriate color when placed.
Then in polygonlevel's init() function, there would be a code like this to give gems their color ingame as well:
for(var n = 0; n < this.Gem.length; n++){
var val = this.Gem[n].value;
if( val == 1 )
this.Gem[n].sprite = sprGemRed;
else if( val == 2 )
this.Gem[n].sprite = sprGemGreen;
else if( ...
}
I don't know how to remove objects from the level array. (your code there seems like magic o.o, but it works great
)
(...)
When there is gem count, it should be rised in spyro.js in gem x spyro collision. The gem should be also removed from the array there, or just marked as 'alive = false' and then removed later at the end of the step maybe.
Hmm... I must admit I hadn't thought much about removing objects o.o' (or if I did, I can't remember what I thought)
Marking objects with 'alive = true/false', and then sort them out when we know it won't cause trouble for loops, sounds like a good way to do it.
But there is the fact that the objects are listed both in the general "object[]" array, as well as for example "Gem[]" or "Enemy[]".
I need to think about that for a bit.
Edit:
Seems I forgot the part where polygonlevel creates it's arrays for various game objects when doing my fix commit ><
Edit:
Fixed that as well, and...
Gem colors now work
(made another commit)
http://host-a.net/u/Greenblizzard/Spyrogame_Gems.zip
Last edited by Sheep (Aug 24, 2014 8:47 PM)
Offline
#105 Aug 25, 2014 11:06 AM
- Ulfbjörn
- Member
- From: Sweden
- Registered: Sep 18, 2013
- Posts: 54
- Gems: 0
Re: Spyroforum Fan Game - Week of June 23rd
Hm, this seems rather interesting... Do you maintain some kind of backlog for distributing work or is it organized in some other way besides random work on something uploaded to a centralized repository? If not I suggest you do that or it will become increasingly hard to keep track of what is really going on.
But there is the fact that the objects are listed both in the general "object[]" array, as well as for example "Gem[]" or "Enemy[]".
Why not go for a standard inheritance-esque approach (I know javascript doesn't support class inheritance in the common sense of the word but you can still achieve it by specializing objects that are all based on the same basic object) and have an Entity array for which you specialize the required methods such that you can call Update() or OnCollision() for all objects, but each sub-type can perform its own logic on such a call? Having multiple references to the same objects in different places is usually not a good idea.
Also, how strict are you about commitment on this? If it doesn't require continuous hand-ins every xxx days I reckon I could help out a bit for the fun of it. If so my main skills lie in programming and music production.
Last edited by Ulfbjörn (Aug 25, 2014 11:07 AM)
Offline
#106 Aug 25, 2014 4:05 PM
- Gekoncze
- Baby Dragon
- From: Czech Republic
- Registered: May 16, 2009
- Posts: 5,389
- Gems: 145
- Age: 31 years old
- Gender: Male
Re: Spyroforum Fan Game - Week of June 23rd
Hm, this seems rather interesting... Do you maintain some kind of backlog for distributing work or is it organized in some other way besides random work on something uploaded to a centralized repository? If not I suggest you do that or it will become increasingly hard to keep track of what is really going on.
But there is the fact that the objects are listed both in the general "object[]" array, as well as for example "Gem[]" or "Enemy[]".
Why not go for a standard inheritance-esque approach (I know javascript doesn't support class inheritance in the common sense of the word but you can still achieve it by specializing objects that are all based on the same basic object) and have an Entity array for which you specialize the required methods such that you can call Update() or OnCollision() for all objects, but each sub-type can perform its own logic on such a call? Having multiple references to the same objects in different places is usually not a good idea.
Also, how strict are you about commitment on this? If it doesn't require continuous hand-ins every xxx days I reckon I could help out a bit for the fun of it. If so my main skills lie in programming and music production.
Well, there was an organization at the beginning, its in the first post - each group has its own job to do but... I just didn't wan't to wait much ^.^' and worked on the sparx and the gems.
I wanted to do some inherence, so I tried learning js inherence, but it's a bit confusing. It seemed like it depends on the order in which the constructors are created.. or maybe I did something wrong.
Ask Stormy if you could help in some way
Offline
#107 Aug 25, 2014 8:48 PM
- Spyrofan25
- New Member
- Registered: Apr 27, 2014
- Posts: 4
- Gems: 0
- Birthday: 25 December
- Gender: Male
Re: Spyroforum Fan Game - Week of June 23rd
Amazing stuff here:o I have a suggestion i like to see in this forum fangame The evil sorceress
Spyrofan forever
Offline
#108 Aug 26, 2014 6:57 PM
- Sheep
- Member
- From: Norway
- Registered: Jan 24, 2008
- Posts: 984
- Gems: 5
- Birthday: 20 January
- Age: 31 years old
- Gender: Male
- Website
Re: Spyroforum Fan Game - Week of June 23rd
I think I got an object removal code working
(committed)
Amazing stuff here:o I have a suggestion i like to see in this forum fangame The evil sorceress
![]()
Having The Sorceress return would be a little strange, wouldn't it, considering she just died(?) (presuming this game takes place after YotD)
Although, a few days ago, I played with the idea of some inhabitants in a level unsuccessfully conspiring to resurrect her
Offline
#109 Aug 27, 2014 11:31 AM
- Gekoncze
- Baby Dragon
- From: Czech Republic
- Registered: May 16, 2009
- Posts: 5,389
- Gems: 145
- Age: 31 years old
- Gender: Male
Re: Spyroforum Fan Game - Week of June 23rd
So, I think we could go with polygon level, right sheep? What about the 2D vs 2.5D? We could then have our first task finally complete
Having The Sorceress return would be a little strange, wouldn't it, considering she just died(?)
We could add a cutscene where she rises her hand from the lava thingy again
Last edited by Gekoncze (Aug 27, 2014 11:33 AM)
Offline
#110 Aug 27, 2014 12:49 PM
- Sheep
- Member
- From: Norway
- Registered: Jan 24, 2008
- Posts: 984
- Gems: 5
- Birthday: 20 January
- Age: 31 years old
- Gender: Male
- Website
Re: Spyroforum Fan Game - Week of June 23rd
I'm personally happy with 2D(not 2.5D). It does simplify things.
@Sorceress thingy:
Haha, another time? Well, since she survived the first time, she's probably immune. Or maybe the pink lava/acid was more lethal O.o
Edit:
Fixed the charging sprite
Last edited by Sheep (Aug 27, 2014 4:38 PM)
Offline
#111 Aug 29, 2014 5:45 PM
- Gekoncze
- Baby Dragon
- From: Czech Republic
- Registered: May 16, 2009
- Posts: 5,389
- Gems: 145
- Age: 31 years old
- Gender: Male
Re: Spyroforum Fan Game - Week of June 23rd
Another thing to think about: when spyro is staying, he slides down a slope even if it is only a very tiny angle. This was especially annoying with gems. Don't you know how to fix this Sheep? Maybe we could let the sliding only on slippery ground.
Offline
#112 Aug 29, 2014 6:17 PM
- Sheep
- Member
- From: Norway
- Registered: Jan 24, 2008
- Posts: 984
- Gems: 5
- Birthday: 20 January
- Age: 31 years old
- Gender: Male
- Website
Re: Spyroforum Fan Game - Week of June 23rd
Yup, that annoys me too xD I do know how to fix it, I just haven't gotten around to do it yet, as I wanted to do all the Spyro sprites first, but now that I've slowed down my work on those, maybe I should just get that sliding fixed
Edit:
Fixed the sliding issue in a commit.
Last edited by Sheep (Aug 29, 2014 7:45 PM)
Offline
#113 Aug 30, 2014 12:30 PM
- RadSpyro
- Member
- From: Avalar (UK)
- Registered: Apr 18, 2008
- Posts: 515
- Gems: 0
- Age: 36 years old
- Gender: Male
- Website
Re: Spyroforum Fan Game - Week of June 23rd
I'll be working on a basket and treasure chest sprite soon. Are there any other items that need a sprite right now?
DeviantArt
Tumblr
Visit me and stuff.
Offline
#114 Aug 30, 2014 12:54 PM
- Gekoncze
- Baby Dragon
- From: Czech Republic
- Registered: May 16, 2009
- Posts: 5,389
- Gems: 145
- Age: 31 years old
- Gender: Male
Re: Spyroforum Fan Game - Week of June 23rd
Sheep: good job
RadSpyro: gems maybe
Offline
#115 Sep 05, 2014 3:18 PM
- Sheep
- Member
- From: Norway
- Registered: Jan 24, 2008
- Posts: 984
- Gems: 5
- Birthday: 20 January
- Age: 31 years old
- Gender: Male
- Website
Re: Spyroforum Fan Game - Week of June 23rd
Another sprite:) The first frame is a transition between jumping and gliding(the last four frames, which will loop).
That leaves hovering, headbutt, crashing(into a wall while charging), perhaps a general "take damage" sprite, and a death sprite. I might have forgotten a couple...
Offline
#116 Sep 05, 2014 6:22 PM
- Gekoncze
- Baby Dragon
- From: Czech Republic
- Registered: May 16, 2009
- Posts: 5,389
- Gems: 145
- Age: 31 years old
- Gender: Male
Re: Spyroforum Fan Game - Week of June 23rd
Do you have a fire attack sprite? I was just thinking of implementing it soon ^.^
Offline
#117 Sep 05, 2014 6:52 PM
- Sheep
- Member
- From: Norway
- Registered: Jan 24, 2008
- Posts: 984
- Gems: 5
- Birthday: 20 January
- Age: 31 years old
- Gender: Male
- Website
Re: Spyroforum Fan Game - Week of June 23rd
No... I'm a little unsure about that one, because in the ps1 games, Spyro moves his head forward while flaming, and has a full body flame animation when standing still, but this won't work with my sprites, because I can't move his head independently in all the various animations, and it would look strange if he had a flame animation only when standing still.
Or did you mean simply a flame sprite? ( I don't have that either )
Still, go ahead and implement!
Offline
#118 Sep 05, 2014 10:08 PM
- Flapjacks
- Member
- From: California, United States
- Registered: Jan 20, 2013
- Posts: 1,745
- Gems: 0
- Birthday: 5 October
- Age: 25 years old
- Gender: Male
Re: Spyroforum Fan Game - Week of June 23rd
You could remake all of the sprites that allow Spyro to flame while being used so that they have no head, then make a head sprite for Spyro that gets placed onto him when not flaming, and another one for when he is flaming. I don't know much about making games, but in terms of design, this is all I can think of.
I'm not sorry if I offended you.
Offline
#119 Sep 10, 2014 1:31 PM
- Gekoncze
- Baby Dragon
- From: Czech Republic
- Registered: May 16, 2009
- Posts: 5,389
- Gems: 145
- Age: 31 years old
- Gender: Male
Re: Spyroforum Fan Game - Week of June 23rd
I was thinking of improving main menu and adding pause menu. How would you like those to look like?
As for the main menu I thought it would be nice to follow the classic style with spyro and enemies doing some suff there, not sure about the sign with a logo.
Last edited by Gekoncze (Sep 10, 2014 1:37 PM)
Offline
#120 Sep 10, 2014 2:10 PM
- Sheep
- Member
- From: Norway
- Registered: Jan 24, 2008
- Posts: 984
- Gems: 5
- Birthday: 20 January
- Age: 31 years old
- Gender: Male
- Website
Re: Spyroforum Fan Game - Week of June 23rd
We could have a sign with 'spyroforum' on it
Pause menu... I think the one in Spyro 3 was nice: nothing exaggerated, and keeps the last frame of the game pretty much intact, which minimizes the time needed for the player to "get into" playing again.
Edit:
Hover sprite done
Last edited by Sheep (Sep 10, 2014 3:38 PM)
Offline
#121 Sep 13, 2014 1:14 PM
- Gekoncze
- Baby Dragon
- From: Czech Republic
- Registered: May 16, 2009
- Posts: 5,389
- Gems: 145
- Age: 31 years old
- Gender: Male
Re: Spyroforum Fan Game - Week of June 23rd
I didn't imagine before how many sprites needs to be drawn. You're doing great with those Sheep! Are you going to put them in the game when they're all done or you're going to test some of them soon?
I added pause menu.
How are we going to make the player save the game? Will it print some code like the editor does?
As for the fire attack head problem, we'll try and see. Maybe there would be needed one only for spyro standing, because that would look most weird if only flame appeared in front of him. As I imagine it when spyro moves, it does not look so weird, but maybe it's just my imagination helping it a bit We might also go with Flapjacks idea.
Last edited by Gekoncze (Sep 13, 2014 1:19 PM)
Offline
#122 Sep 13, 2014 2:55 PM
- Sheep
- Member
- From: Norway
- Registered: Jan 24, 2008
- Posts: 984
- Gems: 5
- Birthday: 20 January
- Age: 31 years old
- Gender: Male
- Website
Re: Spyroforum Fan Game - Week of June 23rd
I didn't imagine before how many sprites needs to be drawn. You're doing great with those Sheep! Are you going to put them in the game when they're all done or you're going to test some of them soon?
I added pause menu.
How are we going to make the player save the game? Will it print some code like the editor does?
As for the fire attack head problem, we'll try and see. Maybe there would be needed one only for spyro standing, because that would look most weird if only flame appeared in front of him. As I imagine it when spyro moves, it does not look so weird, but maybe it's just my imagination helping it a bitWe might also go with Flapjacks idea.
I did some testing with idle, running, slowing down, and jumping, but never shared it... When I have all basic gameplay ones(moving around, jumping, falling, gliding, hover), I'm going to add what I have to the game. Hm... oh, right, I do have those I'll try to have those implemented some time tomorrow! (meaning no charging or headbash to start with)
Nice menu
For game saving, I think we can use HTML5 Local Storage.
Edit:
Didn't get the sprite implementation done today... perhaps tomorrow?
Last edited by Sheep (Sep 14, 2014 7:41 PM)
Offline
#123 Sep 19, 2014 4:26 PM
- Gekoncze
- Baby Dragon
- From: Czech Republic
- Registered: May 16, 2009
- Posts: 5,389
- Gems: 145
- Age: 31 years old
- Gender: Male
Offline
#124 Sep 19, 2014 10:50 PM
- Sheep
- Member
- From: Norway
- Registered: Jan 24, 2008
- Posts: 984
- Gems: 5
- Birthday: 20 January
- Age: 31 years old
- Gender: Male
- Website
Re: Spyroforum Fan Game - Week of June 23rd
http://www.allmystery.de/dateien/uh4433 … leweed.gif
Anything I could help with? ^.^'
Ahh, sorry
I had to rewrite and add quite a bit to Spyro's movement and collision code to make him behave right with those different animations, so there was more I had to do than I first anticipated. Then in the middle of it, I got too tired to do anything for two or three days. Today I finally got back to programming a bit. Now he's behaving pretty much right, I just need to structure the code, and make him stop when gliding into a wall.
The main difference in the collision thing, apart from sticking to the ground while walking, is that to test if he's on the ground, instead of the slightly smaller, lowered circle test, he does a raycast straight down, and will only consider himself onGround if the line the ray hits isn't too sloped( I added a SPYRO_SLOPE_ANGLE_LIMIT variable that's currently set to 45° ), and only if he has ground straight below his center. That's pretty much how it is in the PS1 games. This worked better with making him align himself with the terrain.
I'm a little unsure how to structure the code and where to put what... for example, should the sprites for different animations be set in his draw() function, or within the behavior code? And with both jump, glide and hover, should they be in the same function or each their own? There's also code that is run every frame, like
if jumping{}
else if gliding{}
else if hovering{}
else if falling{}
and so on...
How would you prefer to have this?
Offline
#125 Sep 20, 2014 8:30 AM
- Gekoncze
- Baby Dragon
- From: Czech Republic
- Registered: May 16, 2009
- Posts: 5,389
- Gems: 145
- Age: 31 years old
- Gender: Male
Re: Spyroforum Fan Game - Week of June 23rd
I'm a little unsure how to structure the code and where to put what... for example, should the sprites for different animations be set in his draw() function, or within the behavior code? And with both jump, glide and hover, should they be in the same function or each their own? There's also code that is run every frame, like
if jumping{}
else if gliding{}
else if hovering{}
else if falling{}
and so on...
How would you prefer to have this?
hm, I think I would need to see the code first.
I guess the sprites should be set at certain events (like pressing the button, being hit by an enemy etc). I think that could make the timing more easier, but if you already did it other way and it works fine, then you can keep it.
I'm not sure what you meant by the rest. If there was a lot of code inside each branch of the conditions, then we might put those in separate functions. (for better readability)
Offline