Search found 4 matches

by Marksman
Thu Mar 02, 2006 5:18 pm
Forum: Game Programming
Topic: 2D: SpriteCollision on layers not possible?
Replies: 8
Views: 3021

This one should just check Enemies behind the buildings:

Repeat

ExamineKeyboard():ExamineMouse():ClearScreen(0,0,0)

Gosub MakeEnemies
Gosub CheckEnemies ; if they are out of screen
Gosub MoveEnemies

DisplayTransparentSprite(#Sprite_Building,400,300)
DisplayTransparentSprite(#Sprite_Mouse ...
by Marksman
Thu Mar 02, 2006 4:29 pm
Forum: Game Programming
Topic: 2D: SpriteCollision on layers not possible?
Replies: 8
Views: 3021

The actual Structure is this:

Structure Enemy

x.l
y.l
speed.l
direction.l
layer.l

EndStructure

NewList Enemy.Enemy()

And the CollisionCheck this:

If SpritePixelCollision(#Sprite_Mouse,MouseX(),MouseY(),#Sprite_Enemy,Enemy()\x,Enemy()\y) And MouseButton(1)

What value should "layer ...
by Marksman
Thu Mar 02, 2006 1:07 am
Forum: Game Programming
Topic: 2D: SpriteCollision on layers not possible?
Replies: 8
Views: 3021

Okay, but what about a complex set of some trees and 20 enemies flying around?
by Marksman
Wed Mar 01, 2006 11:02 pm
Forum: Game Programming
Topic: 2D: SpriteCollision on layers not possible?
Replies: 8
Views: 3021

2D: SpriteCollision on layers not possible?

Hi,

why does this function returns true if i shot with the mouse
on the top left corner of the blue building? It shouldn't, because the
part of the (red) enemy is behind the building, not visible and
so should not be hitable.

If SpritePixelCollision(#Sprite_Mouse,MouseX(),MouseY(),#Sprite_Enemy,x ...