Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
I want to make a wall, help me please
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  12 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Keenan  
View profile  
 More options Dec 23 2008, 10:48 pm
From: Keenan <dus...@gmail.com>
Date: Tue, 23 Dec 2008 19:48:37 -0800 (PST)
Local: Tues, Dec 23 2008 10:48 pm
Subject: I want to make a wall, help me please
I got the basic, by editing the mover class  (but i use
movingThing :D )

public void pmove(double distance)
    {
        double angle = Math.toRadians( getRotation() );
        int x = (int) Math.round(getX() + Math.cos(angle) * distance);
        int y = (int) Math.round(getY() + Math.sin(angle) * distance);

        List p = getWorld().getObjectsAt(x, y, Wall.class);
        Iterator i = p.iterator();
        while(i.hasNext())
            {
            while(i.hasNext())   <<< i want to loop by decreasing the
speed, but no work :(
            {
                  angle = Math.toRadians( getRotation() );
                  x = (int) Math.round(getX() + Math.cos(angle) *
(distance - w) );
                  y = (int) Math.round(getY() + Math.sin(angle) *
(distance - w) );
                  w++;
                  break;
            }
            }

            if(!i.hasNext())
            {
                w=0;
                setLocation(x, y);
            }

    }

That code will check if there is a wall.class at the target position,
if there, i want to decrease the speed, so it will be smoother but it
did not work.

I want to create more smooth movement, like if the object is at world
edge.
help me pleasee ^_^


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mjrb4  
View profile  
 More options Dec 24 2008, 7:02 am
From: mjrb4 <berry...@gmail.com>
Date: Wed, 24 Dec 2008 04:02:07 -0800 (PST)
Local: Wed, Dec 24 2008 7:02 am
Subject: Re: I want to make a wall, help me please
Creating one while loop inside another isn't the way to go about
decreasing the speed smoothly - if it did decrease it noticeably at
all, then all it'd do was make the game run more jerkily!

Personally, I wouldn't edit the mover class at all to do this, I'd
create a subclass and put all your code there. If I've understood you
correctly, then you just want something to slow down before it hits
something else? Just because it's christmas (almost), here's a demo
with source. Have a look at it and you should be able to work out what
it's doing :)

http://greenfootgallery.org/scenarios/519


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Keenan Mandela  
View profile  
 More options Dec 25 2008, 4:09 am
From: "Keenan Mandela" <dus...@gmail.com>
Date: Thu, 25 Dec 2008 16:09:22 +0700
Local: Thurs, Dec 25 2008 4:09 am
Subject: Re: [Greenfoot Discuss] Re: I want to make a wall, help me please

nooo, not like that
like...

you create an object, maybe.. it called car, in the subclass of mover

you move it, to the world edge, the car stoped
and then you turn slowly, and the car move along the edge

thats what i want to do, but not at the world edge, but at wall.

hmm... aha, think like the world edge is an object :)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mjrb4  
View profile  
 More options Dec 25 2008, 7:21 am
From: mjrb4 <berry...@gmail.com>
Date: Thu, 25 Dec 2008 04:21:01 -0800 (PST)
Local: Thurs, Dec 25 2008 7:21 am
Subject: Re: I want to make a wall, help me please
Sorry, I'm still not entirely sure what you mean - do you want the car
to turn gradually when it comes close to a wall then head off in
another direction?

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Keenan Mandela  
View profile  
 More options Dec 25 2008, 9:36 am
From: "Keenan Mandela" <dus...@gmail.com>
Date: Thu, 25 Dec 2008 21:36:27 +0700
Local: Thurs, Dec 25 2008 9:36 am
Subject: Re: [Greenfoot Discuss] Re: I want to make a wall, help me please

no problem !!!  :-)

hmm, nope, i want the car stop ! :D, stop like at the world edge.

stop, for i while, i handle if car, get collision with other object,
turn(-180); so its move back.
but i want to.. like at the world edge ^_^


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Keenan Mandela  
View profile  
 More options Dec 25 2008, 9:39 am
From: "Keenan Mandela" <dus...@gmail.com>
Date: Thu, 25 Dec 2008 21:39:53 +0700
Local: Thurs, Dec 25 2008 9:39 am
Subject: Re: [Greenfoot Discuss] Re: I want to make a wall, help me please

i think i will put all the source
...
i think again i will upload it to the gallery ^_^"


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mike H.  
View profile  
 More options Dec 25 2008, 11:02 am
From: "Mike H." <motormichae...@gmail.com>
Date: Thu, 25 Dec 2008 10:02:04 -0600
Local: Thurs, Dec 25 2008 11:02 am
Subject: Re: [Greenfoot Discuss] Re: I want to make a wall, help me please

make it check if its intersecting the wall object and if it is then turn it


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Keenan Mandela  
View profile  
 More options Dec 25 2008, 11:20 am
From: "Keenan Mandela" <dus...@gmail.com>
Date: Thu, 25 Dec 2008 23:20:06 +0700
Local: Thurs, Dec 25 2008 11:20 am
Subject: Re: [Greenfoot Discuss] Re: I want to make a wall, help me please

not turning, stop
btw, i already uploaded the scenario : ) take a look please : )
http://www.greenfootgallery.org/scenarios/522


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mjrb4  
View profile  
 More options Dec 26 2008, 5:41 am
From: mjrb4 <berry...@gmail.com>
Date: Fri, 26 Dec 2008 02:41:10 -0800 (PST)
Local: Fri, Dec 26 2008 5:41 am
Subject: Re: I want to make a wall, help me please
In what way does that scenario not do what you want it to do? The
apple hits the wall, and stops...

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Keenan Mandela  
View profile  
 More options Dec 27 2008, 3:41 am
From: "Keenan Mandela" <dus...@gmail.com>
Date: Sat, 27 Dec 2008 15:41:38 +0700
Local: Sat, Dec 27 2008 3:41 am
Subject: Re: [Greenfoot Discuss] Re: I want to make a wall, help me please

yes, but if you slowly turn (press up too), then the apple just 'jumping'
compare it with if the apple go to world edge
if you go to world edge, the apple stop. but if you turn slowly, the apple
move slowly.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mjrb4  
View profile  
 More options Dec 28 2008, 10:08 am
From: mjrb4 <berry...@gmail.com>
Date: Sun, 28 Dec 2008 07:08:35 -0800 (PST)
Local: Sun, Dec 28 2008 10:08 am
Subject: Re: I want to make a wall, help me please
I see what you mean now - I think. Have a look at http://greenfootgallery.org/scenarios/524

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Keenan  
View profile  
 More options Dec 28 2008, 1:12 pm
From: Keenan <dus...@gmail.com>
Date: Sun, 28 Dec 2008 10:12:02 -0800 (PST)
Local: Sun, Dec 28 2008 1:12 pm
Subject: Re: I want to make a wall, help me please
thanks !
that is what i looking for :-)

thanks !

On Dec 28, 10:08 pm, mjrb4 <berry...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »