Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 22nd, 2024, 4:21 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Bouncing Ball Problem
PostPosted: January 13th, 2013, 3:26 pm 
Offline

Joined: May 24th, 2007, 11:02 am
Posts: 132
Location: UK - Wales - Ceredigion
Opus: illuminatus > Evolution
OS: Windows 10 Pro
System: i7 8GB RAM
I have just gone through the bouncing ball tutorial - (as a refresh as I haven't been using opus for some time)
http://www.digitalworkshop.com/resource ... nce1.shtml

When I run the final example in Opus 8.06 there seems to be a problem with the ball never stopping at the bottom - if you use the script console to view the y value, you will see what I mean.
http://www.digitalworkshop.com/resource ... rialP4.zip

The way I read the code, this is what would happen as it never stops due to this line:
speedy = speedy + gravity
i.e always add 1

Also, when the ball lands, the user can't pick the ball up again if they click below the half-way line of the ball.

Was it always like this? Or did it work in an old version of opus?


Top
 Profile Visit website  
 
 Post subject: Re: Bouncing Ball Problem
PostPosted: January 15th, 2013, 11:37 pm 
Offline

Joined: May 24th, 2007, 11:02 am
Posts: 132
Location: UK - Wales - Ceredigion
Opus: illuminatus > Evolution
OS: Windows 10 Pro
System: i7 8GB RAM
speed should be added to fix the main problem with the script:

if (pos_2.y + speedy > floory2) { ...


After playing with the tutorial I got a bit carried away .... I've made a VERY basic game out of it :)

I could develop this more if I had time.. but it was good practice!

5 levels - basically, you use the blue ball to grab the red ball (by slowly trapping it under your blue ball) and then try different challenges with the balls.

There's so much more I could do with this... but time isn't something I have a lot of.. but I will be using this code in one of my projects soon.


You do not have the required permissions to view the files attached to this post.


Top
 Profile Visit website  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 35 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group