Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

drawPolyLine() Leaving Streaks at Endpoints

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Ignore this post. I found out what was wrong. Silly error
 
Proudly marching to the beat of a different kettle of fish... while reading this tiny ad
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic