Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by ajainvivek

I am trying to add slope collision map .....I am unable to figure how to add the collision map....as i am newbie to this engine.....any sort of help appreciated!!

The collision map code is put below
var collisionMap = {"layerName":"collision","tileSize":32,"imgSrc":"http://nicolahibbert.com/demo/javascript-tile-map-editor/tilemap_32a.png","mapData":[[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0],[[24,20,18,16,14,13,12,10,9,8,7,7,6,5,4,4,3,3,2,2,1,1,1,1,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,1,1,1,2,2,2,3,3,4,4,5,6,7,7,8,9,10,12,13,14,16,18,21,24],0,0,0,0,0,0,0,0]]}

1 decade ago by congwang0517

i am also a newbie. you can create a collision map by using weltmeister. It's a visual tool to create map and entities. And it will generate js file automatically. You needn't tap the code as you put above.
good luck to you!

1 decade ago by ajainvivek

Thanks congwang0517.... but i need a collision entity whr the biker can ride over the hump...so from previous post i jus figured out they create collision map and add it ....but i m not gettin add the above collision.....

1 decade ago by dominic

Usually you create your collisions maps in Weltmeister, but you can create them "by hand" as well. See ig.CollisionMap.

I wish I could give you a better answer, but your question is extremely vague. We can't read your mind. Which biker? Which hump? What did you try? What did you expect? What did happen instead?

1 decade ago by ajainvivek

Hi Dominic,

I hav slope entity in the game....biker need to ride over the slope entity .....i dont know hw to hav slope sort of entity.. when biker collides with slope he needs to go over the slope .... I am not pretty aware hw do i proceed to it...coz i m newbie to game development.....

Thanks
Ajain

1 decade ago by dominic

Set the biker&039;s <1> to #ig.Entity.TYPE.A, create a "ramp" Entity class, set its .type to ig.Entity.TYPE.B and use the ramp&039;s <2> method to adjust the the <3> of the #other Entity that is overlapping with it (i.e. the biker).

I'm not sure this will help, but we are not going to write the game for you.

My advice is to buy a JavaScript book, read some tutorials, read the Impact documentation, have a look at the source code of the demo games and just try stuff.

1 decade ago by gxxaxx

And don't forget the "Video Tutorial: Create a Game" -- http://impactjs.com/documentation/video-tutorial-create-a-game

It was a very nice introduction to the environment and gave a good jumping off point for experimenting.

1 decade ago by ajainvivek

thanks dominic for the suggestion.... i hav question can v swap the biker enitity with another biker sprite entity wen it comes across ramp.....meanwhile i wil giv a try....

1 decade ago by dominic

Yes.

1 decade ago by ajainvivek

Guys,

I am unable to swap the entity on collision.... i hav put down my code ....

//Entity bikerCross
ig.module(
  	"game.entities.bikerCross"
).requires(
    "impact.entity"
).defines(function ABC() {
type: ig.Entity.TYPE.B,
// BikerCross code
}
}


// Biker Entity
ig.module(
    "game.entities.biker",
	
).requires(
    "impact.entity",
"game.entities.bikerCross"
).defines(function() {

 // Entity type
        type: ig.Entity.TYPE.A,
       checkAgainst: ig.Entity.TYPE.B,

        check: function(other) {
				// Swap the entity
                            other.ABC();  // unable to figure out
                       },	 

Thanks
Ajain
Page 1 of 1
« first « previous next › last »