Delphi 7 图像限制来自另一张图像
我正在 Delphi 7 中为学校做一个游戏项目,我似乎无法限制 JazzJackrabbit 角色的图片进入另一个被认为是障碍的图像。我们的老师说我们必须使用顶部和左侧属性来限制图像,这就是我编码的内容:
IF (imgJazz.Top < image1.Top + image1.Height) then
Begin
MessageDLG('Careful you just lost life',mtCustom,[mbOK],0);
iLife := iLife - 10;
pnlLife.Caption := IntToStr(ilife);
imgJazz.Top := 136;
imgJazz.Left := 0;
end;//For IF
这个语句不起作用,因为当图像远离图像但与其顶部内联时,它仍然会说“小心,你只是”失去了生命”。
I'm doing a game project for school in Delphi 7 and I can't seem to limit a picture which is a JazzJackrabbit character from entering another image which is supposed to be an obstacle. Our teacher said we have to use the Top and left properties to limit the image and this what I coded:
IF (imgJazz.Top < image1.Top + image1.Height) then
Begin
MessageDLG('Careful you just lost life',mtCustom,[mbOK],0);
iLife := iLife - 10;
pnlLife.Caption := IntToStr(ilife);
imgJazz.Top := 136;
imgJazz.Left := 0;
end;//For IF
This statment isn't working because when the image is far away from the image but inline with its Top it still says 'Careful you just lost life'.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是家庭作业,因此我不会为您提供完整的解决方案。我将尝试指导您自己寻找解决方案。
问题是你只听从了老师的部分建议。
您只遵循了此处提出的建议的一半。遵循这一切,你就会解决你的问题。
This is homework and as such I won't give you a full solution. I will attempt to guide you towards finding a solution yourself.
The problem is that you have only followed part of your teacher's advice.
You have only followed half of the advice presented here. Follow it all and you will solve your problem.