Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

weinch

DELPHIX-----Background Sprite

This topic is 5556 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m trying to make a 2D game with DelphiX. I want to use the collision map of the background. But i don''t know how to use this. I have this for initialize: tback = class (tbackgroundsprite) public procedure DoMove(MoveCount: Integer); override; procedure DoCollision(Sprite: TSprite; var Done: Boolean); override; end; I don''t know if i need to use the procedure DoCollision of my background but i put it. When i load the map then i initilize the background: miback:=tback.create(dxspriteengine.engine); with miback do begin setmapsize(mwidth,mheihgt); collisioned:=true; image:=textures.Items.Find(''back''); for i:=0 to mwidth do for j:=0 to mheight do begin chips[i,j]:=map[i,j]; collisionmap[i,j]:=cols[i,j]; end; z:=-2; tile:=true; timer.Enabled:=true; mueve:=false; end; Map is Array [0..255,0..255] of byte and cols is Array [0..255,0..255] of boolean. The sprites can detect the collision with another sprites but can''t detect the collision with the blocks of the collisionmap marked with true. What is it that i need to collide with impassable blocks?

Share this post


Link to post
Share on other sites
Advertisement

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!