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

Report as inappropriate.

danpost
danpost presents ...

2012/11/25

Snake Tracks Demo

A demonstration of using tracks to hold directional information for the segments of the snake.

Three worlds are demonstrated. One with 4-way movement, the other two with universal movement. One of the universal movement type worlds is more of a smooth-mover type snake.

4446 views / 20 in the last 7 days

1 vote | 0 in the last 7 days

Tags: demo with-source snake uaslp danpost

This scenario is a member of: Demos by danpost


open in greenfoot
Your browser does not support the canvas tag.
danpostdanpost

2013/4/16

That is something you should avoid doing -- 'Sorry, GAME OVER!'.
PointifixPointifix

2014/3/5

nice made, but the collision detection in world 3 i noticed, is not the cleanest could that be, cause the snake stopped about 15px before "real collesion"
danpostdanpost

2014/3/5

@Pointifix, in world 3, the snake segments are rotated which, for one, widens the width and height of the images. Also, the snake is moved 5 pixels at a time and it stops if it cannot move the whole five pixels. Together, I believe it covers the 15 pixels you mentioned.
PointifixPointifix

2014/3/5

the 15 pixels i got with my screen lineal ;) i did a 360 degrees snake once as well and i had the same "problem" the snake always stops before it really collide. but jeah i did this with c++
danpostdanpost

2014/3/5

@Pointifix, the demo was more for the movement of the snake, not for the collision detection; so, I do not think I will worry about it. Unless, you have a need for better and need some help?
PointifixPointifix

2014/3/5

im doing such things for fun so theres never a "need" ;) to get the better collision i think you have to know where circles are drawn cause the array of position i made is 10 times larger then the chain links to fit the spaces between, but jeah thats work i were to lazy for as i made this ;)
PointifixPointifix

2014/3/5

maybe difficoult for you to image this now probably you realized this another way then i did ;)
danpostdanpost

2014/3/5

@Pointifix, my Pong Pinball scenario, at http://www.greenfoot.org/scenarios/7455, has collision detection between circles and rectangles you might be interested in looking at.
PointifixPointifix

2014/3/5

clear ;D is there anything you did not yet ;D but nice, your account is like a stand alone library ;)
A new version of this scenario was uploaded on 2020-10-31 10:00:59 UTC

See all comments

Want to leave a comment? You must first log in.

Who likes this?

miles7191