Make Mario Stop Disappearing
Author |
Message |
Emknight552
|
Posted: Mon Nov 22, 2010 6:47 pm Post subject: Make Mario Stop Disappearing |
|
|
What is it you are trying to achieve?
Stop sprite from flickering
What is the problem you are having?
sprite won't stop flickering
Describe what you have tried to solve this problem
I have tried everything at this link
I think i may be doing something wrong
Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
File is attached
Turing: |
put "See attached file"
|
Please specify what version of Turing you are using
I am currently using turing 4.1.1
Description: |
|
Download |
Filename: |
walkingmariosprite.zip |
Filesize: |
21.36 KB |
Downloaded: |
88 Time(s) |
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
TokenHerbz
|
Posted: Mon Nov 22, 2010 8:56 pm Post subject: Re: Make Mario Stop Disappearing |
|
|
Few things to start.
inside your main loop, you should never have more then 1 delay, or more then one view.update.
having not used any sprites before, i'm not sure this is the most effective/efficient way to use your code... BUT...
LOGICALLY, you want it set up so that your images alternate threw the "moveing" images, and draw them when they are called... and thats it.
well let me re-do your answer tomorrow sometimes, im getting my wisdom tooth surgery thing tomorrow so that'll suck and had drinks inside me tonight, so not really on the ball as i normally would be,
Anyways i made it work to how you wanted it to work, But its very crappy how you have this set up TBH, and i will tell you better ways and explain why/how this other ways better etc later.
for now, play around with this and make him JUMP up and land back to normal, and have him controllable by a players KEY directions in the meanwhile...
code: |
View.Set ("graphics, offscreenonly, nobuttonbar, nocursor")
var walk : int := Pic.FileNew ("walk.jpg")
var walk1 : int := Pic.FileNew ("walk1.jpg")
var walk2 : int := Pic.FileNew ("walk2.jpg")
var walksp : int := Sprite.New (walk)
var walk1sp : int := Sprite.New (walk1)
var walk2sp : int := Sprite.New (walk2)
var next : int := 0
loop
for i : 1 .. (maxx - 50) by 2
if next = 0 then
% View.UpdateArea (0, 0, maxx, maxy)
Sprite.SetPosition (walksp, i, 100, false)
Sprite.Show (walksp)
% Sprite.Hide (walksp)
elsif next = 1 then
Sprite.SetPosition (walk1sp, i, 100, false)
Sprite.Show (walk1sp)
% Sprite.Hide (walk1sp)
elsif next = 2 then
Sprite.SetPosition (walk2sp, i, 100, false)
Sprite.Show (walk2sp)
% Sprite.Hide (walk2sp)
end if
delay (50)
View.Update
Sprite.Hide (walksp)
Sprite.Hide (walk1sp)
Sprite.Hide (walk2sp)
if next = 2 then
next := 0
else
next += 1
end if
end for
end loop
|
|
|
|
|
|
|
iToast
|
Posted: Wed Nov 24, 2010 9:23 am Post subject: Re: Make Mario Stop Disappearing |
|
|
My game is better...
Also, try View.Update... i told you to try it in class
|
|
|
|
|
|
TokenHerbz
|
Posted: Wed Nov 24, 2010 9:52 am Post subject: RE:Make Mario Stop Disappearing |
|
|
for people still learning the programming concept they should first learn how things work such as proc/fcn's and understanding the basics of programming and how/why it works, before attempting to use it in turing very poorly made OOP class.
Further, even if your game is better how is this beneficial for the OP to learn / fix his/her game? and understand it.
the fact that i have a View.Update even in my code i left for the OP, makes your post absolutely useless... you have nothing useful to add and your promoting a copy/paste idea, which gets people no where.
The better ways i wanted to talk to him about will be helpful to him, if he puts effort into trying to get his character to jump, as i requested, if he shows me effort he'll get better understandings.
|
|
|
|
|
|
|
|