Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

drawPolyLine() Leaving Streaks at Endpoints

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am currently using drawPolyLine(int[], int[], int[].length) to draw a line representing the ground coordinates for a platforming game. However, the endpoints are leaving streaks when I scroll across the screen. I fixed the one that was at the end by simply using vals.length - 1 (for the length of the array) instead of vals.length

I know for a fact that both the arrays I am passing in for coordinates, xVals and yVals, are the same length. I am wondering why the first point leaves a line behind as it scrolls.

Here is a picture showing what is happening Problem Picture

You can see that the very first point left a streak (Sonic was falling downwards, which is why the streak goes down).
 
Ike Gentz
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ignore this post. I found out what was wrong. Silly error
 
Can you shoot lasers out of your eyes? Don't look at this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic