tag:blogger.com,1999:blog-8967321114965538903.post1745335992992780928..comments2023-05-13T09:33:56.238+01:00Comments on Lane Defence: Tutorial 3 : The Enemy ClassFireFlyhttp://www.blogger.com/profile/08398015936723710602noreply@blogger.comBlogger23125tag:blogger.com,1999:blog-8967321114965538903.post-80577358005895542892015-04-01T19:46:44.690+01:002015-04-01T19:46:44.690+01:00Very thank to you for useful tutorial!!!Very thank to you for useful tutorial!!!Tracer8https://www.blogger.com/profile/09340056798107917860noreply@blogger.comtag:blogger.com,1999:blog-8967321114965538903.post-50271249311701321772013-08-18T15:37:09.666+01:002013-08-18T15:37:09.666+01:00Hi Roman,
I will try to upload it later, but for ...Hi Roman,<br /><br />I will try to upload it later, but for now you can get it from the zip file linked to at the bottom of the tutorial!FireFlyhttps://www.blogger.com/profile/08398015936723710602noreply@blogger.comtag:blogger.com,1999:blog-8967321114965538903.post-30116772771099103642013-08-18T14:45:50.165+01:002013-08-18T14:45:50.165+01:00Give please link to enemy.png It's brokenGive please link to enemy.png It's brokenAnonymoushttps://www.blogger.com/profile/03411027827379738922noreply@blogger.comtag:blogger.com,1999:blog-8967321114965538903.post-15208407209069453512012-05-09T10:07:08.532+01:002012-05-09T10:07:08.532+01:00when i try to change the enemy texture all i get i...when i try to change the enemy texture all i get is a black box. is there some speciel conditions the images has to meet?<br /><br />ex. transparancy, .png. speciel size for them to be drawn?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8967321114965538903.post-36917087436811641052012-02-09T18:15:47.053+00:002012-02-09T18:15:47.053+00:00You need to make sure each class has the word publ...You need to make sure each class has the word public in front of it e.g :<br /><br />public class Enemy<br />{<br /><br />}<br /><br />public class Sprite<br />{<br /><br />}FireFlyhttps://www.blogger.com/profile/08398015936723710602noreply@blogger.comtag:blogger.com,1999:blog-8967321114965538903.post-44244643922477220422012-02-09T17:56:07.709+00:002012-02-09T17:56:07.709+00:00Error 1 Inconsistent accessibility: base class ...Error 1 Inconsistent accessibility: base class 'Tower_Defence_game.Sprite' is less accessible than class 'Tower_Defence_game.Enemy' C:\Users\Lewis\Documents\Visual Studio 2010\Projects\Tower Defence game\Tower Defence game\Tower Defence game\Enemy.cs 10 18 Tower Defence game<br /><br />It keeps saying this?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8967321114965538903.post-78719442551115883032012-01-09T05:11:53.540+00:002012-01-09T05:11:53.540+00:00The name 'enemy1' does not exist in the cu...The name 'enemy1' does not exist in the current context<br /><br />Not sure what to fix... ThanksAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8967321114965538903.post-86593118534205163742012-01-04T15:39:56.960+00:002012-01-04T15:39:56.960+00:00I draw my enemy but he doesnt move anywhere, think...I draw my enemy but he doesnt move anywhere, think you know what the problem is? feels like i dont give him any direction to move in.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8967321114965538903.post-40095686542739900332011-10-29T11:32:40.871+01:002011-10-29T11:32:40.871+01:00It is there, it is just really hard to see, it is ...It is there, it is just really hard to see, it is just above the line in italic.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8967321114965538903.post-18650061716714573602011-10-28T19:56:26.929+01:002011-10-28T19:56:26.929+01:00Agreed. Where's my ugly creep texture!?Agreed. Where's my ugly creep texture!?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8967321114965538903.post-5476014946556014082011-08-24T20:40:25.826+01:002011-08-24T20:40:25.826+01:00There isn't a enemy texture in your tutorial :...There isn't a enemy texture in your tutorial :SAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8967321114965538903.post-33357074985169019732011-01-22T10:48:53.379+00:002011-01-22T10:48:53.379+00:00Hey thanks for pointing that out, it turns out tha...Hey thanks for pointing that out, it turns out that you are not allowed to use the Inequality signs :S I have fixed it though.FireFlyhttps://www.blogger.com/profile/08398015936723710602noreply@blogger.comtag:blogger.com,1999:blog-8967321114965538903.post-36260308363012971002011-01-21T18:21:15.601+00:002011-01-21T18:21:15.601+00:00The Comments delete spiky brackets...
Content.Load...The Comments delete spiky brackets...<br />Content.Load<br />(spiky bracket here) < <br />Texture2D <br />> (spiky bracket here)<br />("enemy");Alexhttp://t-hawks.denoreply@blogger.comtag:blogger.com,1999:blog-8967321114965538903.post-62288136990900251202011-01-21T18:18:35.690+00:002011-01-21T18:18:35.690+00:00Hi,
there is an error in the texture loading.
gam...Hi,<br /><br />there is an error in the texture loading.<br />game1 -> LoadContent() -><br />Texture2D enemyTexture = Content.Load("enemy");<br />has to be:<br />Texture2D enemyTexture = Content.Load("enemy");<br /><br /><br />If you want to fade your enemy from green to red:<br />Color color = new Color(new Vector3(1 - healthPercentage, healthPercentage, 0));<br /><br />anyway nice tutorials :DAlexhttp://t-hawks.denoreply@blogger.comtag:blogger.com,1999:blog-8967321114965538903.post-17388142705494631262011-01-13T12:50:17.965+00:002011-01-13T12:50:17.965+00:00ok i got it, now workingok i got it, now workingAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8967321114965538903.post-8693923776638709782011-01-13T00:55:01.950+00:002011-01-13T00:55:01.950+00:00I think the confusion with the 'Tower_Defence....I think the confusion with the 'Tower_Defence.Enemy.Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch)': no suitable method found to override' error is from editing the sprite draw method.<br /><br />This tutorial does not edit the Sprite Draw method from the previous tutorial, it adds a second one. When finished with this tutorial, their should be one draw method in the Enemy class and two in the Sprite class.Seanhttps://www.blogger.com/profile/01118140887632225602noreply@blogger.comtag:blogger.com,1999:blog-8967321114965538903.post-79292039614176804582011-01-11T16:36:52.945+00:002011-01-11T16:36:52.945+00:00Hey,
Are you sure that your Enemy class is inheri...Hey,<br /><br />Are you sure that your Enemy class is inheriting from the sprite class (see the start of this tutorial) and if so are you sure you added all the correct methods to the sprite class? (See previous tutorial).FireFlyhttps://www.blogger.com/profile/08398015936723710602noreply@blogger.comtag:blogger.com,1999:blog-8967321114965538903.post-14119344224415456232011-01-11T15:26:03.048+00:002011-01-11T15:26:03.048+00:00hey i get error: 'Tower_Defence.Enemy.Draw(Mic...hey i get error: 'Tower_Defence.Enemy.Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch)': no suitable method found to override<br /><br />dont know whats wrong..Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8967321114965538903.post-32599816502241355182010-12-31T10:23:06.142+00:002010-12-31T10:23:06.142+00:00Thanks for the kind words! I'm not sure I unde...Thanks for the kind words! I'm not sure I understand your suggestion though, the Draw method simply overrides one of the Sprite classes draw methods :).FireFlyhttps://www.blogger.com/profile/08398015936723710602noreply@blogger.comtag:blogger.com,1999:blog-8967321114965538903.post-35429229762335045972010-12-29T21:53:02.608+00:002010-12-29T21:53:02.608+00:00Just wanted to say that these tutorials are great!...Just wanted to say that these tutorials are great! one problem though. You do not need to override the Draw method as you are overloading the actual method and this provides a seperate method signature and will yield an error if it does not find a method with that exact same signature. better to do public void Draw and call Draw(spriteBatch, color) in the method.sdwragehttps://www.blogger.com/profile/10624619612830319480noreply@blogger.comtag:blogger.com,1999:blog-8967321114965538903.post-15483311779352642862010-12-17T15:39:10.635+00:002010-12-17T15:39:10.635+00:00Thanks for pointing that out - Fixed :)Thanks for pointing that out - Fixed :)FireFlyhttps://www.blogger.com/profile/08398015936723710602noreply@blogger.comtag:blogger.com,1999:blog-8967321114965538903.post-82411016229325825102010-12-03T19:17:11.026+00:002010-12-03T19:17:11.026+00:00Also, the instructions should say to go back to th...Also, the instructions should say to go back to the Enemy class before you add this code...<br /><br />public override void Draw(SpriteBatch spriteBatch)<br />{<br /> <br />}Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8967321114965538903.post-38867931484232858092010-12-03T18:01:43.371+00:002010-12-03T18:01:43.371+00:00I think the line
Texture2D enemyTexture = Conten...I think the line <br /><br />Texture2D enemyTexture = Content.Load("enemy");<br /><br />needs to be <br /><br />Texture2D enemyTexture = Content.Load("enemy");<br /><br />also since the file name when you download it is apckuo perhaps it should be...<br />Texture2D enemyTexture = Content.Load("apckuo");Anonymousnoreply@blogger.com