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

2018/1/13

Help me with the creation of my game called 'aa'

1
2
3
frequency frequency

2018/1/25

#
The image will need to be around 400 long with one side (longways) being transparent.
The image is always transparent. Do you mean i need to make it thicker? 400pixels height?
All it needs to do is rotate and set the rotation of all its intersecting arrows to its new rotation
So i use the code that you gave me getintersectingactors or smthing? How do i make the syntax? Thank you!
danpost danpost

2018/1/25

#
frequency wrote...
400pixels height?
Yes. First 200 colored in.
So i use the code that you gave me getintersectingactors or smthing? How do i make the syntax?
You know ... it might be easier for you to cheat and just have the arrows rotate the same speed as the circle. Just make sure that if you change the rotational speed of one, that you change the other as well. So, you only need to use the 'turn' method within the act method of the circle. Post the code for the Circle class when done. Also, you do not need the '1's after the class names -- Dot, Circle and Arrow should do just fine.
frequency frequency

2018/1/26

#
Hello, I have done the arrow and i will upload the scenario in a bit. Now i want to make the dot move ONLY ONCE and be placed at a certain position. For now i use
    void move()
    
    {
    if (Greenfoot.isKeyDown("space"))
    {
           setLocation(getX(), getY() - 4);

    }
But it keeps on moving. Based on the updated scenario,how would you set the small ball to be placed at a Y possision since i place it vertically? And if we succeed with this,how will i spawn the arrow to get attached to the miniball,and the main body? Thanks
danpost danpost

2018/1/26

#
frequency wrote...
i want to make the dot move ONLY ONCE and be placed at a certain position. For now i use << Code Omitted >> But it keeps on moving.
You will need a boolean field to track the state of the "space" key. That way, you will be able to tell at what instant the key is actually pressed (instead of just when it is in the down position):
// the field (outside of any methods) in Dot class
private static boolean spaceDown;

// in some method
if (spaceDown != Greenfoot.isKeyDown("space")) // is there a change in state of key
{
    spaceDown = !spaceDown; // track the new state
    if (spaceDown) // key went down
    {
        setLocation(getX(), getY()-4);
    }
}
Based on the updated scenario,how would you set the small ball to be placed at a Y possision since i place it vertically? And if we succeed with this,how will i spawn the arrow to get attached to the miniball,and the main body?
The phrase "get attached" should be stated as "appear to get attached". If you made the image of the arrow 400 high, then when placed at the location of the circle, its end will be at 200 more along the y-coordinate than its location. This is precisely where the mini-ball should be moved to when the space key is detected. Also, when detected, you will be creating the arrow and adding it to the world where the circle is located.. I wrote that kind of backwards in order; but, I was trying to answer the question foremost. The arrows are not actually "attached" to the circle; but, when you have them turn at the same rotational speed as the circle rotates, they will appear to be attached. Each arrow will keep a reference to its ball and control that ball to keep its "apparent" location at the end of its image.
frequency frequency

2018/1/26

#
This is so hard lol.This is my first year using Greenfoot. I pasted the code. I feel bad somehow since i tell you sideways to give me the code. :/ Noticed that while pressing space it keeps on going. You got the objective of the project. But i keep missing somethings in the duration. It is sad.
frequency frequency

2018/1/26

#
Hey Mr Dan. I know this might sound ridiculous,but can i talk to you personally on skype or something? A call? I will give full credits to you,even though we chat or not. My skype is "ilias.counter" . I would love to have a chat with you and hear your opinion on this!
danpost danpost

2018/1/26

#
Maybe you should not try something so extensive the first year in. Or, maybe you could read up on some tutorials to improve your programming knowledge and skills. The place to start is with the java tutorials. The 'Getting Started' and 'Learning the Java Language' should be understood first and foremost.
danpost danpost

2018/1/26

#
frequency wrote...
Hey Mr Dan. I know this might sound ridiculous,but can i talk to you personally on skype or something? A call? I will give full credits to you,even though we chat or not. My skype is "ilias.counter" . I would love to have a chat with you and hear your opinion on this!
I do not skype ... sorry. My last post might be helpful, however.
You need to login to post a reply.
1
2
3