Ask me for help on a project, and I will do my best to help you solve your issue (programming only please). Anybody who wants to help can!
Last edited by Cyclone103 (2008-05-29 16:51:32)
Offline
I have a question. In this project
http://scratch.mit.edu/projects/archmage/105910
Whenever I move It bounces around and I am not quite sure why. The code is loosely based on a script for a scripted camera in flash actionscript but the flash one doesn't bounce around. I don't really have any ideas about what would make it bounce so maybe you can help me out and see if you can get rid of the bounce.
EDIT: Problem fixed. I was taking the wrong approach with the camera sprite. I developed a new script that works great
Last edited by archmage (2008-05-22 21:36:21)
Offline
The solution - Make the scroll speed not rely on the delay. It seems at though if scroll speed were faster, and the delay is set to 1, there should be no bounce. It appears to just be the plane sprite trying to catch up with itself. With your coding, did you make it so the plane would move a set distance away from (0,0) based on velocity and direction? If it is, then just get rid of those scripts. If it is not, then please clarify exactly what was used that might have made the plane off-centered in the first place. Perhaps if that motion of velocity/direction script has a script to negate the effect and return the plane to its original position, it is overcompensating and the numbers should just be fine-tuned a little. Hope this helped you a bit!
Offline
Wow, someone helping archmage, I'd never thought I'd see the day
Offline
Cyclone103 wrote:
The solution - Make the scroll speed not rely on the delay. It seems at though if scroll speed were faster, and the delay is set to 1, there should be no bounce. It appears to just be the plane sprite trying to catch up with itself. With your coding, did you make it so the plane would move a set distance away from (0,0) based on velocity and direction? If it is, then just get rid of those scripts. If it is not, then please clarify exactly what was used that might have made the plane off-centered in the first place. Perhaps if that motion of velocity/direction script has a script to negate the effect and return the plane to its original position, it is overcompensating and the numbers should just be fine-tuned a little. Hope this helped you a bit!
There are no velocities. There aren't a lot of scripts of I'll print the main scripts here.
On player (plane) sprite
change x by ( x of camera/ (delay*-1)
change y by ( y of camera/ (delay*-1)
on the camera sprite
when green flag clicked
forever
set x to (x position of player)
set y to (y position of player)
change scrollX by (camX*-0.5)
set camX to (camX+(x position- camX) / delay)
change scrollY by (camY*-0.5)
set camY to (camY+(y position- camY) / delay)
It's just something I made up. I don't even really understand how it works that well.
If you can get the bounce to go away could you please post the project.
Last edited by archmage (2008-05-22 21:05:39)
Offline
geckofreak wrote:
Wow, someone helping archmage, I'd never thought I'd see the day
I am not really that great of a programmer. I ask my java teacher for help all the time.
Offline
Okay, lets see if you can solve this problem. I have a Project called Defend Thy Castle. In it, stickfigures run up to the castle and supposdly, if you click them, they dissapear. Online for some reason it doesn't work but in the scratch maker it does. I would love it if you could tell me how to fix it.
Offline
I don't think I really explained what the scrolling project was supposed to do.
I want the scrolling to be exactly like the scrolling in the following flash file.
http://spamtheweb.com/ul/upload/220508/75821_Platformer_Engine.php
(a,w,d to move the guy)
I don't know how to explain it any other way.
Last edited by archmage (2008-05-22 21:09:00)
Offline
archmage wrote:
Cyclone103 wrote:
The solution - Make the scroll speed not rely on the delay. It seems at though if scroll speed were faster, and the delay is set to 1, there should be no bounce. It appears to just be the plane sprite trying to catch up with itself. With your coding, did you make it so the plane would move a set distance away from (0,0) based on velocity and direction? If it is, then just get rid of those scripts. If it is not, then please clarify exactly what was used that might have made the plane off-centered in the first place. Perhaps if that motion of velocity/direction script has a script to negate the effect and return the plane to its original position, it is overcompensating and the numbers should just be fine-tuned a little. Hope this helped you a bit!
There are no velocities. There aren't a lot of scripts of I'll print the main scripts here.
On player (plane) sprite
change x by ( x of camera/ (delay*-1)
change y by ( y of camera/ (delay*-1)
on the camera sprite
when green flag clicked
forever
set x to (x position of player)
set y to (y position of player)
change scrollX by (camX*-0.5)
set camX to (camX+(x position- camX) / delay)
change scrollY by (camY*-0.5)
set camY to (camY+(y position- camY) / delay)
It's just something I made up. I don't ever really understand how it work that well.
If you can get the bounce to go away could you please post the project.
Ok I got it! The delay is the amount of offset from the camera towards the plane. Your decay scripts for this offset are overcompensating. All that you have to do is change your -0.5 to something larger like -.7, and it will overshoot by less. Granted, it will return to the center more slowly, but the bounce is caused by it moving too fast past the original point, then overcompensating for that a little bit. It really is a simple problem, and I think that if you change the decay, it will help. By making the rate of decay larger, (smaller, and by this I mean the difference from 1 to the current rate)
it will lessen bounce.
Offline
Bobby500 wrote:
Okay, lets see if you can solve this problem. I have a Project called Defend Thy Castle. In it, stickfigures run up to the castle and supposdly, if you click them, they dissapear. Online for some reason it doesn't work but in the scratch maker it does. I would love it if you could tell me how to fix it.
Problem - The stick figures are too small! Just make them a bit larger. If that still does not work, the perhaps you have a conflicting script, that tells them to show even after they have been clicked.
Offline
Cyclone103 wrote:
Bobby500 wrote:
Okay, lets see if you can solve this problem. I have a Project called Defend Thy Castle. In it, stickfigures run up to the castle and supposdly, if you click them, they dissapear. Online for some reason it doesn't work but in the scratch maker it does. I would love it if you could tell me how to fix it.
Problem - The stick figures are too small! Just make them a bit larger. If that still does not work, the perhaps you have a conflicting script, that tells them to show even after they have been clicked.
I noticed your project has a title screen that fades away at the start of the game. I know that hidden sprites can still block mouse clicks when the project is run online. This has been a problem on a number of projects recently. The solution is to move the sprite as far off the screen as you can when you hide it, then it won't block the mouse clicks. Just remember to bring it back where it belongs if it needs to be displayed again.
I don't know if this behavior is something new or not but it is certainly a pain.
Offline
Well, I thought it was just plain hard to click, since they move so fast and they are so small.
Offline
Cyclone103 wrote:
Well, I thought it was just plain hard to click, since they move so fast and they are so small.
That might still be the problem...or part of the problem. I just commented because I have seen (and exerienced) a lot of issues with clicking on sprites behind hidden sprites in the online Java player. I haven't actually tested my proposed fix on this particular project...but it's worked on two or three other ones so I thought it worth mentioning. Please excuse me for butting in.
Offline
Okay, I will try both of those.
Offline
Hope they work! Its ok Paddle, I do not mind
Offline
archmage wrote:
geckofreak wrote:
Wow, someone helping archmage, I'd never thought I'd see the day
I am not really that great of a programmer. I ask my java teacher for help all the time.
You take Java? I gag in jealousy! My computer teacher makes us learn keyboarding year after year.
Offline
fullmoon wrote:
archmage wrote:
geckofreak wrote:
Wow, someone helping archmage, I'd never thought I'd see the day
I am not really that great of a programmer. I ask my java teacher for help all the time.
You take Java? I gag in jealousy! My computer teacher makes us learn keyboarding year after year.
Lol I take digital art, and the only program we use is Fireworks, which I cannot use at home, since it costs hundreds of dollars. I also wish my teacher would teach Java!!!!!!!!!
Offline
Cyclone103 wrote:
fullmoon wrote:
archmage wrote:
I am not really that great of a programmer. I ask my java teacher for help all the time.You take Java? I gag in jealousy! My computer teacher makes us learn keyboarding year after year.
Lol I take digital art, and the only program we use is Fireworks, which I cannot use at home, since it costs hundreds of dollars. I also wish my teacher would teach Java!!!!!!!!!
You can, however download a 30-day trial (fully functional). I managed to get Flash for $250 at Campustech. It might be worth looking into!
Offline
I do not have hundreds of dollars to spend, but I do know a place to get Java for free. (also a trial) I do not know how to program in it, but it looks like it might be very interesting I wish that Flash, and Java were both normally free, so maybe I could program in them like I do Scratch.
Offline
Cyclone103 wrote:
I do not have hundreds of dollars to spend, but I do know a place to get Java for free. (also a trial) I do not know how to program in it, but it looks like it might be very interesting I wish that Flash, and Java were both normally free, so maybe I could program in them like I do Scratch.
Java is totally free from Sun's website. It is not a trial version. It does not expire. Java has been totally free since before the release of version 1.2 in 1997. We are now at version 1.6 and it is still totally free.
You will find everything that you need to program in Java at:
http://java.sun.com/javase/downloads/index.jsp
Get it, use it, and if you need to learn how to use it, see the tutorial links in my signature.
Offline
THANK YOU SO MUCH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! I will be sure to learn all I can from your very nice site!!!!!!!!!!!
Offline
Well, do you have multiple costumes? If it is just one costume, copy it exactly and have this script "If touching enemy and costume number=1, change health by -1", and just have it switch to the second costume if the character is attacking. If the character has multiple costumes, have the same script, but for the non-attack costume being costume 1. I hope this works!
Offline