This site requires JavaScript, please enable it in your browser!
Greenfoot back
Roshan123
Roshan123 wrote ...

2021/5/18

Ray casting

1
2
3
Roshan123 Roshan123

2021/5/23

#
danpost wrote...
It is going to take time to sort things out. The code is quite "bulky" and there is a lot to go over. I having changed anything yet with respect to the issues. Still assembling data in my head. The Ray mechanism, itself, is fine (at least, I believe so).
Ohh, i see. I thought u r changing the whole code for which i was little bit worried. And abt "bulky", i think the program might be more confusing becaz of poor arrangement and improper variable naming. Hope u would be able to understand it properly
danpost danpost

2021/5/25

#
Found some faulty logic in your EnemyTank1 class. In the checkTouching method, you have:
if (block == null) ...
else if (block != null) ...
else if (block == null) ...
The last else-if will never execute its code.
Roshan123 Roshan123

2021/5/25

#
danpost wrote...
The last else-if will never execute its code.
Got it. Thanks!!! But can u recognise the reason why it acts wierd when crate is again added to world and the and the path between them is obstructed?
danpost danpost

2021/5/25

#
Roshan123 wrote...
can u recognise the reason why it acts wierd when crate is again added to world and the and the path between them is obstructed?
I'll let you know if and when I find something.
Roshan123 Roshan123

2021/5/26

#
java.lang.IllegalArgumentException: Width (0) and height (8) cannot be <= 0 at java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:1016) at java.awt.GraphicsConfiguration.createCompatibleImage(GraphicsConfiguration.java:186) at greenfoot.util.GraphicsUtilities.createCompatibleTranslucentImage(GraphicsUtilities.java:186) at greenfoot.GreenfootImage.<init>(GreenfootImage.java:130) at Ray.isUnobstructed(Ray.java:11) setImage(new GreenfootImage(length,8));(edited) at EnemyCannon2.act(EnemyCannon2.java:60) if(ray.isUnobstructed(this,redPlayer))(edited) at greenfoot.core.Simulation.actActor(Simulation.java:567) at greenfoot.core.Simulation.runOneLoop(Simulation.java:530) at greenfoot.core.Simulation.runContent(Simulation.java:193) at greenfoot.core.Simulation.run(Simulation.java:183) Today i noticed that it seldomly gives me error when i play in duo. in solo also its given sometime
danpost danpost

2021/5/26

#
Omg -- look at from where ay and by get there values in the Ray class.
Roshan123 Roshan123

2021/5/27

#
I m not sure, but i opened ray class and then i changed the last most line i.e. (Obstacle.class).size()<=2 to .size()==0 From this i observed that if u keep the bot in the left hand side of the screen then the bot will not move towards the crate even if the path is unobstructed and if u place the bot in right hand side its not working. It moves on, no matter what, even if the path is unobstructed or not, it keeps on moving towards the crate if its in right hand side of the screen To observe the above one....click on solo....let the 2 crate be removed from the world....now let the 3rd crate be added in the world....now when the 3rd crate is addded... place the bot at every corner and then observe it I think after changing this line may be the reason of getting such type of error
danpost danpost

2021/5/27

#
Roshan123 wrote...
i changed the last most line i.e. (Obstacle.class).size()<=2 to .size()==0
You only implemented Obstacle in your B class as far as tanks are concerned. So, that is probably something to look into.
Roshan123 Roshan123

2021/5/27

#
danpost wrote...
You only implemented Obstacle in your B class as far as tanks are concerned.
Sry if i misunderstood. Is their something else to be written in B class? I thought thier is no need of writing. If i have to write, then what should i write?
danpost danpost

2021/5/27

#
Roshan123 wrote...
Sry if i misunderstood. Is their something else to be written in B class? I thought thier is no need of writing. If i have to write, then what should i write?
Either no tank should be Obstacle or all should be. The ray will not count well when inconsistent.
Roshan123 Roshan123

2021/5/27

#
danpost wrote...
Either no tank should be Obstacle or all should be. The ray will not count well when inconsistent.
Is it working on ur pc? I tried but yet now crate mechanism is not working properly
Roshan123 Roshan123

2021/5/27

#
Now i m thinking that it would be better to remove ray class and i will only use it in blue bot class for crate mechanism
Roshan123 Roshan123

2021/5/27

#
If u don't mind can i ask u something? U may become angry. The request is not necessary. It can also be done if u deny. I request u to allow me to aks u something...plz It may be easier to solve the problem but u may become annoyed which concerns me a bit
danpost danpost

2021/5/27

#
Roshan123 wrote...
If u don't mind can i ask u something? U may become angry. The request is not necessary.
That which annoys me is that you have to ask about asking.
Roshan123 Roshan123

2021/5/27

#
danpost wrote...
That which annoys me is that you have to ask about asking.
It was a warning so that u can settle down yourself before reading it I want u to download the latest version of "Dawn of tank" I have used ray class only in blue bot class and i will be only using it for crate mechanism which would be more easier to fix the problem Download it and open blue bot...scroll down and read the 1st most commentt
There are more replies on the next page.
1
2
3