Most likely there are too many messages in the chat history or output.
Please check this document: https://www.forum.creaticode.com/topic/867/ai-openai-chatgpt
This group is for users who have assisted others by answering or helping with at least 5 situations. Eligible users may request to join the group.
Most likely there are too many messages in the chat history or output.
Please check this document: https://www.forum.creaticode.com/topic/867/ai-openai-chatgpt
The forum link is here for the sneak peaks: https://forum.creaticode.com/topic/1995/sneak-peak-for-my-next-game
I need a top-down character that looks like an Elite from Halo. No mandibles (unless we are talking about the spikes near his mouth from the armor, in which case add that), just the armor and stuff. The dude should be a deep blue color, idle position, and don’t include any weapons. Make sure this is on a white or PNG picture. If you could also make hands that would be great (EVERYTHING IS CIRCULAR). If you do this I thank you very much because I suck at everything when it comes to art.
Flappy Bird is a simple and fun game, where the player controls the bird to fly through a few obstacles to reach its nest. There is only one control: press the SPACE key to make the bird flap.
In this tutorial, you will learn to build a simple AI program to control the bird instead of manually.
Note that this AI will be based on programming logic, rather than large language models (LLMs). That is due to 3 reasons:
The same argument also applies in many other situations, and that’s why a significant portion of AI systems will continue to be implemented using programming logic.
Now let’s get started with this simple AI program.
Open this link and remix the project:
play.creaticode.com/projects/684dbd401c49cae4509533bd
In the “AI” sprite, there are 2 stacks of code.
First, when the green flag is clicked, 3 parameters are set:
Below that, when the “start” message is received, this AI program will simply send out the “flap” message every 0.3 seconds. Each “flap” message will make the bird flap once. This is the most basic AI program, which we will improve in the next few steps.
When you click the green flag, you will find that the bird will fall to the ground. The falling speed will depend on your computer, but it will look similar to this:
This is because the “gravity
” and “flap strength
” are not fine-tuned yet. As an exercise, please adjust these 2 values. In general, “gravity” should be a number between 0 and -2 (such as -0.5), and “flap strength” should be a number between 4 and 20. Your goal should be to make the bird fly horizontally with a nice waveform trail like this:
Currently, in the forever loop, we send out the “flap” message every 0.3 seconds, and the bird will stay at the same height. Suppose we want the bird to fly higher, then we need to use a shorter interval.
Instead of 0.3 seconds, let’s use an interval of 0.03 seconds. This may be necessary if the bird needs to rise up very quickly.
As a result, when you run again, the bird should reach the ceiling very quickly and stay there:
Obviously, the current AI always makes the bird fly too high. A simple solution is to skip some flaps, so the bird will do a free fall to reach nests that are below its level.
In general, to make smart decisions, an AI needs relevant sensing data. In this case, to determine whether the bird needs to fall a bit, we can compare these 2 variables:
Your AI can access these 2 values using these 2 reporter blocks:
Now, can you change the forever loop so that the bird would not flap if it is already above the nest?
Here is one way to do it: we put the broadcast block inside an “if-then” block, so only when the nest is above the bird would the bird make a flap:
Try to run the program a few times. The nest is placed at random heights, but the bird will almost always rise or fall to its level quickly:
Now let’s move on to the next challenge: make the bird fly through the columns (pipes). Change the “columns” variable to 4, which will add 4 columns:
Obviously the bird will crash with the columns and fail. What can we do?
Similar to above, we need to provide data to the AI. Specifically, here are information about the columns:
With these information, can you try to make the bird fly through all the columns? Don’t worry about the nest for now.
In fact, all that we need to do is to replace “nestY” with the Y position of the upcoming column:
The bird should have no problem flying through all columns:
For our last step, we need to combine our solution for columns and the nest. When the bird has passed the last column, the nextColumnIndex
will be more than the columns
variable, and that’s when we should target the nest instead. Can you implement this change?
Here is an example solution:
Here is the final demo:
To practice what you have learned, here is an additional challenge for you.
Currently, the bird would only start flapping if it is below the target height (of the nest or the center of the opening), so it might fall too much below the target. If the target is very low, then the bird might touch the ground before flying back up.
To ensure the bird is always safe, it should start to flap if it is too close to the ground (Y of -240).
@the_true_odst left click is always used to highlight, left click is the primary function for your mouse (mouse button 1 in the system) and interacting with your costumes is your main intent, and right click is secondary (mouse button 2) so its for moving around wtih is a lesser but still big intent
(weapons have been switched from modern to futuristic.)
I was required to make a “catch the falling cookies game” (suggested by CHATGPT) in under 20 minutes (my goal). Here is the finished product:
https://play.creaticode.com/projects/684b55c73d952dd83a793d22
Tell me if you think I should continue on with this
@tyller_ Yeah I tried it and it works on both coding and costume editor. The only problem is is that left click highlights in costume editor and I feel like right click should do that while left click scrolls.
@info-creaticode Thats good to know! @The_True_Odst do you have anything to add?